App name not being displayed - java

My Android app is not displaying the application name "app_name",I have multiple activities but when I restart the app, the first page of the app doesn't show the app name but in other activities it shows the app name. i don't know what is wrong anyone can help me.
This is my AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".HomescreenActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="QuizDetailsActivity"
android:label="#string/app_name" >
</activity>
<activity android:name="QuestionListActivity"
android:label="#string/app_name">
</activity>
<activity android:name="QuizActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".ResultsActivity"
android:label="#string/app_name">
</activity>
</application>

Related

Application crashes when I bind MainActivity to Launcher Intent

Below is the list of classes I have in my application. I am trying to to make MainActivity to be the first to show but my app always starts from the Dashboard. When I change it my app crashes.
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Dashboard"
android:screenOrientation="portrait"></activity>
<activity android:name=".Music"
android:screenOrientation="portrait"/>
<activity android:name=".MusicVideo"
android:screenOrientation="portrait"/>
<activity android:name=".Home"
android:screenOrientation="portrait"/>
<activity android:name=".News"
android:screenOrientation="portrait"/>
<activity android:name=".Relationship"
android:screenOrientation="portrait"/>
<activity android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>`
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

Get "Default Activity not found" when I want to change the starting activity

https://github.com/rrsaikat/Scientific-Calculator-Calc-
I am creating a ScientificCalculator by referring to the above Github link, and I want to display the login activity before opening the calculation screen, but the Default Activity not found is displayed. What should I do?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rrsaikat.calc">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.LOGIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
</activity>
<activity android:name=".LauncherActivity">
</activity>
</application>
</manifest>
Before I edit↓
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rrsaikat.calc">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".LauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

My android studio is installing two apps/apks on my phone

Ok here is the thing I created a project put it on github, then work more on it update it and push updates on github (this is the last version, 2 versions total)...however now whenever I run the app through android studio,(even the version downloaded from github, master) it installs two APPs on my phone...one is the older version and the other is the new version.. How can I remove the old version ? however I only see one android manifest, it seems that both versions are kinda connected together whenever I uninstall, the phone uninstalls them both
EDIT Before fixing
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".TeacherLogin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AddUpdateStudent" />
<activity android:name=".ViewAllStudents" />
<activity android:name=".MainActivity" />
<activity android:name=".NoteMainActivity" />
<activity android:name=".AddNotesActivity" />
<activity android:name=".MainMenuActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
After Fixing
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".TeacherLogin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AddUpdateStudent" />
<activity android:name=".ViewAllStudents" />
<activity android:name=".MainActivity" />
<activity android:name=".NoteMainActivity" />
<activity android:name=".AddNotesActivity" />
<activity android:name=".MainMenuActivity">
</activity>
</application>
Ok so appearntly the second intent was after the main menu which was the version 1.0 before the update, after the update I added login activity, hence why it looked like "2 apps with different versions" so there was no problem what so ever with git or github as I weirdly thought... I appologize if this question was kinda stupid now after I looked at it but I am really new to this android app development.
If you have two launcher icons, but only one entry in Settings > Apps, that means your one app has a manifest with two <activity> elements that each have the <intent-filter> to cause them to appear in the launcher:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SomeOtherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
That may just be a copy/paste error, or perhaps an accidental checkbox click in the new-activity wizard.
Regardless, unless you really do want two launcher icons, remove the <intent-filter> from the activity that does not belong in the launcher.

Strange behaviour of an alphaApk's shortcut

I have noticed that my application that is published to an Alpha test has a strange behaviour... The shortcut is launching the MainActivity again. Everything is working fine when it's installed via generated .apk
My Android-Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.YYY.XXX">
<application
android:name=".Infrastructure.XXXApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.BaseActivity" />
<activity
android:name=".activities.SettingsActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".activities.SavedResultsActivity"
android:screenOrientation="portrait"/>
</application>
</manifest>

Default Activity not found Waiting for process

When I am trying to debug-run my application I am getting this error in console:
Default Activity not foundWaiting for process: com.myapp.myapp
My AndroidManifest look like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name="com.myapp.myapp.Splash"
android:label="#string/app_name"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.Main" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.myapp.myapp.Main"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.Main" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
This doesn't work for me because I can't find any sources tab as mentioned there.
For the second activity, in intent filter, change android:name to com.myapp.myapp.Main .

Categories

Resources