No Launcher activity found - java

I can't find any problem but it keep giving me the error "No Launcher activity found!" and "The launch will only sync the application package on the device!"
can anyone solve this problem???
This is my Maniest
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.saikoro.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.saikoro.StartUp"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.saikoro.StartUp" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

The <activity> element of the activity you want to launch through the icon on the app list must contain both of the following parts of the intent-filter:
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
Your current manifest has an activity with category LAUNCHER and action MAIN, but in different activities. The one with the icon in the app list must have them both.

Change
<action android:name="com.example.saikoro.StartUp" />
with
<action android:name="android.intent.action.MAIN" />

Related

it says apk installed but no apk

I made my schedule. I'm installing but the apk is not there. everything is clear in the picture
I made changes to the manifest, is it something related to it?
Manifest
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<category android:name="android.intent.category.LAUNCHER" />
</activity></intent-filter>
</activity>
<activity
android:name=".guzelsozleractivity"
android:label="#string/app_name" />
</application>
You are declaring MainActivity twice.
Declare it like this:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Your manifest was wrongly entered, update the Manifest.xml to the code given below it will work. Please like and accept the answer if it worked.
Happy coding.
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Installing the debug apk shows up as two apps?

So I am very new to android programming and I was installing a basic app I just built on my android device and I find that it always seems to install two "instances" of the app ? Here is a screenshot of what I am looking at [The two instances are of the SR520 app] :
I did some research and it seems like it could be due to the android manifest file but I am not exactly sure what I should change in it. This is what my manifest file looks like
<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=".SplashActivity" android:theme="#style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Some suggestions would be much appreciated.
Ok I guess I needed to delete this section
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
That fixed the issue.

How to remove splash activity from an existing project?

I have an existing Android Studio project and i wanted to remove splash screen. I tried to remove changes in AndroidManifest.xml but couldn't make it.
Here this my actual AndroidManifest.xml
<!-- Home Tab Group -->
<activity
android:name=".view.TabHomeActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan|stateHidden" >
</activity>
<activity
android:name=".view.activity.SplashActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan|stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.activity.TestLoginFacebookActivity"
android:configChanges="keyboardHidden|orientation"
>
</activity>
<!-- Tab Screen -->
<activity android:name=".view.tabscreen.TabHomeScreen"
android:windowSoftInputMode="stateAlwaysHidden|adjustResize" />
Delete the SplashActivity class,delete it from the manifest. Set the Launching Activity first which you want to come as your first screen
<activity
android:name=".view.TabHomeActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan|stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.activity.TestLoginFacebookActivity"
android:configChanges="keyboardHidden|orientation"
>
</activity>
Delete the SplashActivity class,
delete it's layout,
delete it from the manifest.
Add the intent filters to your TabHomeActivity.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Change default launcher on button click ANDROID

I have this code in my manifest which allows me to set different activities in my application as the launcher. Is there a way that I can implement a button so that on button click it allows me to change the default launcher? For example, when I set the default launcher as settings activity, home activity can't be set as the default. I want the option to change it.
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SettingsActivity"
android:label="#string/title_activity_settings" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".HomeActivity"
android:label="#string/app_name"
android:launchMode="singleTask"
android:stateNotNeeded="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
You can use PackageManager to disable/enable each of your app components but perhaps it would be simpler to stick to one entry point in your app (like StartActivity with no UI (i.e. themed Theme.NoDisplay) which would then call startActivity() on the right one depending on user config.

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