What does it mean "No Launcher activity found!" - android

I am writing a simple program of Android, and getting these no errors, I don't know what they are. My program is right, but showing not output.
I think it is because of these two lines:
[2005-01-06 19:56:38 - my_Android] No Launcher activity found!
[2005-01-06 19:56:38 - my_Android] The launch will only sync the application package on the device!

Here's an example from AndroidManifest.xml. You need to specify the MAIN and LAUNCHER in the intent filter for the activity you want to start on launch
<application android:label="#string/app_name" android:icon="#drawable/icon">
<activity android:name="ExampleActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

Multiple action tags in a single intent-filter tag will also cause the same error.

Like Gusdor said above, "Multiple action tags in a single intent-filter tag will also cause the same error." (Give him the credit! I could just kiss Gusdor for this!)
I didn't find any docs for this fact!
I had added a new (USB) action and being clever, I lumped it in the same intent-filter. And it broke the launch.
Like Gusdor said, one intent filter, one action!
Apparently each action should go in its own intent filter.
It should look like this...
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
When I did this, WAZOO! it worked!

Do you have an activity set up the be the launched activity when the application starts?
This is done in your Manifest.xml file, something like:
<activity android:name=".Main" android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Check your manifest.xml. Make sure you have the category LAUNCHER there.
<activity android:name=".myActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

It means you didn't specify an Activity for Android to launch as the default when the app opens from the launcher. You have to add an Intent Filter in the Manifest for the Activity you would like to act as the default when the app is being launched.
Read http://developer.android.com/guide/topics/intents/intents-filters.html#ccases for more details.

I fixed the problem by adding activity block in the application tag. I created the project using wizard, I don't know why my AdroidManifest.xml file was not containing application block? I added the application block:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".ToDoListActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
And I get the desired output on the emulator.

As has been pointed out, this error is likely caused by a missing or incorrect intent-filter.
I would just like to add that this error also shows up if you set android:exported="false" on your launcher activity (in the manifest).

I had this same problem and it turns out I had a '\' instead of a '/' in the xml tag. It still gave the same error but just due to a syntax problem.

If you are using the standard eclipse IDE provided by google for Android development, you can check the "Launcher Activity" check-box while creating a new Activity. Please find below:

In Eclipse when can do this:
But it is preferable make the corresponding changes inside the Android manifest file.

You missed in specifying the intent filter elements in your manifest file.Manifest file is:
<application android:label="#string/app_name" android:icon="#drawable/icon">
<activity android:name="Your Activity Name"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Add and check this correctly. Hope this will help..

Manifest is case sensitive, so please compare this lines for any case mismatch especially the word MAIN in:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

You can add launcher to activity in eclipse manifest visual editor:

MAIN will decide the first activity that will used when the application will start.
Launcher will add application in the application dashboard.
If you have them already and you are still getting the error message but maybe its because you might be using more than more category or action in an intent-filter. In an intent filter there can only be one such tag. To add another category, put it in another intent filter, like the following
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!--
TODO - Add necessary intent filter information so that this
Activity will accept Intents with the
action "android.intent.action.VIEW" and with an "http"
schemed URL
-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

just add this to your aplication tag in AndroidManifest.xml file
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
and also edit the uses-sdk tag from android:targetSdkVersion="16" to 17
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />

You have not included Launcher intent filter in activity you want to appear first, so it does not know which activity to start when application launches, for this tell the system by including launcher filter intent in manifest.xml

Related

Trying to make a specific activity the main one

I am trying to make login screen the main activity however i receive the error 'activity must be exported or contain an intent filter'. I have also selected it to run from that activity in the Run-Edit configurations settings
Please close the activity tag after intent-filter as:
<activity
android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Did that work for you ?
You just need to wrap intent-filter inside LoginActivity tag
<activity
android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
You are closing the <activity> tag right on declaration, the intent filter must be inside the node
<activity ... >
<intent filter ...
</activity>
I added a snippet of code cause you posted a image of code and actually is a reason for dowvoting.

Multi icon in screen Android [duplicate]

I am writing an Android App that has one main activity and one subactivity. When I install the app on my phone to test it out, I get two icons instead of one. The first icon is for the main activity and the second is for the subactivity. I don't want/need an icon for the subactivity.
Does anyone know how to turn this off in my app code, so that only the icon for the main activity is installed? Any information you can provide is greatly appreciated!
Thanks,
MobiKnow
Does your application manifest list an intent filter under your sub-activity that matches the main launcher?
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Make sure that your sub-activity is not filtering for these intents.
Edit: Just to be very clear, make sure the above lines are not listed under your sub-activity. That intent filter lets the Android system know that you intend for it to be listed as an entry point to your application.
We have the same problem but i fixed it this way
before my code below in manifest
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Notice that in the SplashActivity inside the intent is this code
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
i only deleted the category
<category android:name="android.intent.category.LAUNCHER" />
So after i deleted the intent-filter category in splash it didn't install two app icon but only one for main the code will be like this notice that the intent-filter category is deleted
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
it really helps
It creates two App icon because you must have added the given filter to two of your activities. See manifest.
<category android:name="android.intent.category.MAIN" />
Remove the above statement from the other one. Then you are good to go.
Like in the other answers,
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
Was the culprit. However, in my manifest I only had one activity with that intent filter. As it turns out, I am using a library I built and it has an activity declared in it's manifest which uses that intent filter. So, in short, be sure your app's manifest and dependencies, if any, only have one activity with the intent filter.
I guess that in your AndroidManifest.xml, you've got both activities having the LAUNCHER intent-filter. Remove it from the second activity, and you should be set!
You have
<intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
along with
android:icon="#drawable/icon.png"
set for both activities.
What that means is that this is a launcher icon, put me on the home screen. Only set those for the activit(ies/y) you want on the home screen.
I was searching answer to exactly the same question. It appears the only thing needed (in addition to recommendations on removing MAIN and LAUNCHER intent filter) is to rebuild your project - that will clean things up and upon next launch I saw single icon on my device (just running application on device after changes did not help).
if anyone run into this issue using Pebble SDK. I noticed PebbleKit Androidmanifest.xml holds a LAUNCHER activity as well. This is what caused it for me. Just remove this part. It will not effect Pebble functionality.
SIMPLE answer..
REMOVE:
<category android:name="android.intent.category.LAUNCHER" />
From your AndroidManifest.xml
Leave your intent-filter alone.
<intent-filter android:icon=”drawable resource” android:priority=”Integer” /intent-filter>
Priorities are set for the parent component. This setting may help you to set the parent icon for your Android app development.

Android install each layout like application

I make android application with two layouts, when I export project, and install it on phone and tablet I got two icons in menu, first open main layout, when I start second icon it open second layout
Is problem in layout calling, I make two classes for layout.
How I can solve this? thanx
You just need to call new activity ..
Intent intent = new Intent(YourCurrentActivity.this, NewActivityToOpen.class);
startActivity(intent);
Also don't forgot to define same over AndroidManifest.xml .. :)
<application ...>
<activity android:name=".YourCurrentActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".NewActivityToOpen" />
You may need to put the fully qualified java classname to android:name.
Problem in manifest file.
When you declare activity u sign all activity with
<intent-filter>
<action android:name="android.intent.action.MAIN"
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
android:screenOrientation="landscape"
/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
But this code using only for first activity^ next must declare only like:
<activity
android:name=".YourClass"
android:label="#string/app_name"
>
</activity>

Android first app, all activities visible in menu

I just created my first Android app, all works fine, but all of the activities are shown on my Android menu. What did I do wrong?
Screenshot: imgur.com/9CmXU
I want to have one icon, directing to MainActivity, not all activities
<!-- language-all: lang-html -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myApps.birthdaymeter"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/my_logo"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".BirthdayMeter"
android:label="#string/title_activity_birthday_meter" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AboutWindow"
android:label="#string/title_activity_about_window" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ShowResult"
android:label="#string/title_activity_show_result" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is my manifest, changing logo didn't help
The <intent-filter> tag is used to describe the type of Intents that each Activity will respond to. The "android.intent.action.MAIN" action says that this Activity is an entrance point for your Application (think the main method that a java program requires). The "android.intent.category.LAUNCHER" category tells the OS to display the Activity in your list of Applications. Adding the DEFAULT category is ok, but effectively the same as omitting the <intent-filter> tag completely (which I find to make for much cleaner and easier to read code). You should only be using the <intent-filter> tag with these two actions and categories on the Activity that starts when a user opens your app. If wanted an Activity within your application to be able to respond to some special intents, you would use the tag to define which it responds to.
Here's a link to the google dev pages to help you learn more about Intent Filters.
http://developer.android.com/guide/components/intents-filters.html
Here's the documentation for the <intent-filter> tag. It's not the easiest to understand though.
http://developer.android.com/guide/topics/manifest/intent-filter-element.html
And here's the docs for the Manifest file and the Intent class. Both of these are good for reference if you're not sure about which tags to use in your Manifest. Good luck!
http://developer.android.com/guide/topics/manifest/manifest-intro.html
http://developer.android.com/reference/android/content/Intent.html
You phrased your question extremely generally, so I am not sure what to answer. It seems like you haven't called nameOfActivity.this.finish() when you launched another activity
If you post your manifest file I can help a little more, but it looks to me like you have not declared your activities correctly.
It should be setup somewhat like this:
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="Activity1"></activity>
<activity android:name="Activity2"></activity>
<activity android:name="Activity3"></activity>
</application>
Essentially, create an application declaration, and then include each activity within it.

Android App Development: Two icons getting created and I only need one

I am writing an Android App that has one main activity and one subactivity. When I install the app on my phone to test it out, I get two icons instead of one. The first icon is for the main activity and the second is for the subactivity. I don't want/need an icon for the subactivity.
Does anyone know how to turn this off in my app code, so that only the icon for the main activity is installed? Any information you can provide is greatly appreciated!
Thanks,
MobiKnow
Does your application manifest list an intent filter under your sub-activity that matches the main launcher?
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Make sure that your sub-activity is not filtering for these intents.
Edit: Just to be very clear, make sure the above lines are not listed under your sub-activity. That intent filter lets the Android system know that you intend for it to be listed as an entry point to your application.
We have the same problem but i fixed it this way
before my code below in manifest
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Notice that in the SplashActivity inside the intent is this code
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
i only deleted the category
<category android:name="android.intent.category.LAUNCHER" />
So after i deleted the intent-filter category in splash it didn't install two app icon but only one for main the code will be like this notice that the intent-filter category is deleted
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
it really helps
It creates two App icon because you must have added the given filter to two of your activities. See manifest.
<category android:name="android.intent.category.MAIN" />
Remove the above statement from the other one. Then you are good to go.
Like in the other answers,
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
Was the culprit. However, in my manifest I only had one activity with that intent filter. As it turns out, I am using a library I built and it has an activity declared in it's manifest which uses that intent filter. So, in short, be sure your app's manifest and dependencies, if any, only have one activity with the intent filter.
I guess that in your AndroidManifest.xml, you've got both activities having the LAUNCHER intent-filter. Remove it from the second activity, and you should be set!
You have
<intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
along with
android:icon="#drawable/icon.png"
set for both activities.
What that means is that this is a launcher icon, put me on the home screen. Only set those for the activit(ies/y) you want on the home screen.
I was searching answer to exactly the same question. It appears the only thing needed (in addition to recommendations on removing MAIN and LAUNCHER intent filter) is to rebuild your project - that will clean things up and upon next launch I saw single icon on my device (just running application on device after changes did not help).
if anyone run into this issue using Pebble SDK. I noticed PebbleKit Androidmanifest.xml holds a LAUNCHER activity as well. This is what caused it for me. Just remove this part. It will not effect Pebble functionality.
SIMPLE answer..
REMOVE:
<category android:name="android.intent.category.LAUNCHER" />
From your AndroidManifest.xml
Leave your intent-filter alone.
<intent-filter android:icon=”drawable resource” android:priority=”Integer” /intent-filter>
Priorities are set for the parent component. This setting may help you to set the parent icon for your Android app development.

Categories

Resources