问题
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:
- change something for eclipse rebuild again.
- 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.
回答1:
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.
回答2:
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.
回答3:
It has nothing to do with your manifest file. Whenever your compiled code will change, the new version will install over the previous version. Otherwise, the older app will run.
回答4:
For me it works with this little trick:
Create a new Builder:
Project -> Properties -> Builders -> New -> Program
Name: Touch Manifest
Location: /usr/bin/touch
Arguments: ${project_loc:MyProjectName}/AndroidManifest.xml
Then move it up to the top of the list.
Each time you hit run, it will touch the manifest file and cause a reload of the package.
Enjoy!
edit: changed arguments, ${resource_loc} only works if the project is selected.
回答5:
If you get this warning it means you haven't changed any line of your code and this instance of your project is running on emulator or on your device. So if you want to run that again you can:
1- Make some changes in your code and then compile it again.
2- Or you can easily close the app and then relaunch it with eclipse or android studio or ...
If the problem still persist try to uninstall the app and run it again.
来源:https://stackoverflow.com/questions/9231929/warning-activity-not-started-its-current-task-has-been-brought-to-the-front