Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: Activity not started, its current task has been brought to the front [duplicate]

I think this question is very usual. Many results on Stackoverflow has said about this. The general answer is: because an old app is running, and I try to run a new one from Eclipse (but no change in compile), so Android will notice this.

But, I have done many things as I could:

  1. change something for eclipse rebuild again.
  2. Restart Eclipse or Emulator

But this warning still exists (and of course, my app still cannot run).

Here is my manifest file. Please take a look at this file and help me.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"\
    package="com.game.mrnom"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk android:minSdkVersion="8" />
    <application
        android:debuggable="true"
        android:icon="@drawable/icon"
        android:label="Mr.Nom" >
        <activity
            android:label="Mr.Nom"
            android:name=".MrNomGame"
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"/>
</manifest>

Thank you for reading.

Note: This situation can occur whether or not you are using Eclipse, AndroiStudio or an emulator. It occurs when a application is running and a 'startActivity' request is made to start (perhaps another) activity in that application. The request activity is not started, the previous 'task' of the application is just brought to the foreground. In the case of starting the program from Eclipse, I suspect that Eclipse is issuing a startActivity request to the system on the emulator and that because some task/activity of the application is already in the foreground, that the expected behavior is not seen.

like image 933
hqt Avatar asked Feb 10 '12 17:02

hqt


2 Answers

If you edit one character (delete a character and replace it) and then launch from eclipse, it will re-install the app, and you won't get this message.

like image 168
braden Avatar answered Oct 26 '22 12:10

braden


If the app is already running on the emulator, and you haven't changed anything, you will see that message. Just restart the app on the emulator, ie close out the app then restart it. When you upload an app to the emulator, it loads it like it would on a real phone with an icon and all. you can even put that icon on the emulators home page.

like image 33
Bill Gary Avatar answered Oct 26 '22 11:10

Bill Gary