tags:

views:

71

answers:

3

Hi,

I have a very simple android project. I got the following error message when I try to run it. The emulator is running but the application doesn't come up. I couldn't find any useful information online. Can anyone help me?

Thanks,

arning: Activity not started, its current task has been brought to the front public class Profile extends Activity { /Button button1; CheckBox check1, check2; EditText text1;/

    /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
 }

}

</application>
<uses-sdk android:minSdkVersion="8" />

A: 

Are you missing an intent-filter in your manifest that declares the proper actions and categories for your activity? Maybe you are missing an android.intent.action.MAIN or android.int.category.LAUNCHER?

Robert Nekic
<activity android:name=".Profile" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <categoryandroid:name="android.intent.category.LAUNCHER" /> <categoryandroid:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
Lewis
Shouldn't there be a VIEW action, too?
Robert Nekic
A: 

Hi Lewis!

It is not an error message, it is a warning. What the system is trying to tell you: The application on the device is the same as your application in Eclipse. And because the application is already running on the device, the system tells you that it is not going to kill and restart it, but bring the activity of your already running app into the foreground. This is pretty normal. ;-)

The warning will not continue if you edit your code and run it (because the app is then killed, reinstalled and started) or if you kill your process on the phone, e.g. via the DDMS.

mreichelt
Thanks for your quick comment. However I couldn't see my app running in the emulator. The emulator is running and all I can see is the home screen. What should I do to see my app? When I first created the app I can see it running in the emulator.
Lewis
I think then you might give a shot for Robert's solution - maybe this is your problem. Otherwise: Upload your AndroidManifest.xml to http://pastebin.com and post the link here so we can have a look at it. :-)
mreichelt
A: 

I've seen this before - you want to re-run your app even though you may not have made any code changes. On the emulator, click the back button (to the right of the menu button) and then run your app as usual from Eclipse.

John J Smith
Thanks. Got it fixed.
Lewis