Why doesn't my android application show up in the launcher? - android

I'm developing an application for the Android platform targeted for api level 4 (Android 1.6) but I can't get it to show up on my phone and I can't figure out why. Here's my AndroidManifest.xml is there a problem in here? Or is there something else I should be looking at?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sbe.app.hellocogen"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".activity.ListPlants"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.AddPlant"
android:label="Add Plant">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name=".activity.UnitActivity"
android:label="IP HERE, PLANT NAME">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4"/>
</manifest>
When I started this application it didn't show up but I fixed it by setting the minimum api level to 4 instead of 7 then it started showing up but now it stopped showing up again and I don't know why.

I was having the exact same problem as you. It was working for one activity but not another. Eventually I realised that I had named the tag "activty" instead of "activity". This doesn't throw an error of any kind, just does not recognise the existence of the Activity!
Also, you don't need the ".activity." before the class name. Is your "ListPlants" a ListActivity? If so, this might explain your problem.

Related

No launcher activity found.! The launch will only sync the application package on the device.!

I am facing the problem plzzz help me out. Here is my manifest.xml file.
Plz help me out.......your help is highly appreciated....
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hello.myandroidnew"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myandroidnew.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".second"/>
</application>
</manifest>
Change your intent filter to the following:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
The difference is the action. It must be android.intent.action.MAIN in order to be listed in the launcher.
You have to set the action name properly so that android know that it is the main activity. Change
<action android:name="android.intent.action.MAINACTIVITY" />
to
<action android:name="android.intent.action.MAIN" />
update:-
You specify name of the class in
<activity
android:name="com.example.myandroidnew.MainActivity"
Docs of "android.intent.action.MAIN" specifies :-
public static final String ACTION_MAIN
Added in API level 1
Activity Action: Start as a main entry point, does not expect to receive data.
Input: nothing
Output: nothing
Constant Value: "android.intent.action.MAIN"
Thus you can see that action.MAIN tells android that it is the main entry point i.e. the default activity that is to be shown when the app starts.

Android application won't launch on device

I have developed an Android application using Eclipse which works perfectly on the Android Virtual Device or when running it on my smartphone using Eclipse + USB Debugging mode enabled.
However, when I install the application on my phone using a signed apk file which resided on the sd card and try to launch it I get a "Activity not found - lsp.workshop" error, and the app won't start (lsp.workshop is the application package name).
the AndroidManifest.xml file is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lsp.workshop"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".TwitterLogin"
android:label="#string/app_name" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="twitter" />
<data android:host="log" />
</intent-filter>
</activity>
</application>
</manifest>
What am I doing wrong? Thanks
The emulator and android with a debugger attached can behave differently then when you start an app normally. The timing is different (influences multithreading and race conditions) and other things may be affected as well.
But just to be sure:
Did you list the activity within your AndroidManifest.xml file?
Is the spelling really correct?
If those things are not the problem, then could you show some code (how do you start the activity? with an intent?) and maybe the manifest file ?
Using two intent filters instead of one solved the problem:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="twitter" android:host="log" />
</intent-filter>
When you export your apk,be sure to name it -something.apk ,ie just put the ".apk" at the end when you export the application (y)

App is not shown in launcher for 4.0.3

I can install my app on:
emulators 2.2, 2.3.3;
my phone 2.2.2;
And it's shown in launcher and widgets manager.
But after installing it on emulator 4.0.3, it is not shown in launcher and widgets manager.
Here is manifest:
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoDisplay" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".handlers.MyWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/my_widget_info" />
</receiver>
</application>
Would you help me?
Thanks,
Edited:
This is such a stupid question. I tried to scroll the app list vertically. But in 4.0.3, the list is horizontal.
:-)
So there is no problem with my app. I'm sorry...
Your app widget will not show up in the widgets list until the user runs one of your activities. This behavior is new to Android 3.1.
There is nothing obviously wrong with the activity, though you might try removing Theme.NoDisplay and see if the behavior changes.

app appears in Manage Applications, but not on the main menu

I'm using Eclipse to make an Android app. I've used it before and not had this problem. The console says everything installed ok, so I'm a little confused. I'm not sure what is relevant from logcat, but I can post it if you think that would help.
I've restarted Eclipse, ADB, the emulator, and the Mac several times in various orders and nothing has helped. I know it must be something simple but I haven't played around with this in a few months.
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hyser.pinpoint"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
</application>
<activity android:name=".pinpoint" android:label="pinpoint">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Your Activity needs to be inside of your application tag in your manifest
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name=".pinpoint" android:label="pinpoint">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
It's a similar issue to this:
Unable to start Service Intent
Your <activity> tag needs to be in the <application> block.
Is it possible your manifest does not refer to any activities? If you install an app with no activities in the manifest you will get this behavior.

How to call correctly run few class (intents)?

I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to do this thing: in first class (layout - main.xml) is button "hello", it calls new class (layout - second.xml), in this class are button "hello2", it calss new class. I can't do this cause when I push first button "hello" I getting this messages "The aplication (xxxx) has stopped unexpectedly. Please try again". How to resolve this problem. I think problem is in AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.kodinis_raktas"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".veiksmas"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".second" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".lock"></activity>
<intent-filter>
</intent-filter>
</application>
<uses-permission android:name="android.permission.SEND_SMS">
</uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS">
</uses-permission>
<uses-sdk android:minSdkVersion="3" />
</manifest>
Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine LogCat and look at the stack trace associated with your error. That will give you more information.
I would recommend getting rid of the <intent-filter> elements from .second and .lock, since you are not using them. If your error is coming from trying to start .second, the existence of your category-only <intent-filter> may well prevent that activity from being started.
In my limited experience with android I think you need to add this line after activity android:name=".second"
android:label="#string/app_name">

Categories

Resources