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?
Warning: 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);
}
}
<EditText android:text="#+id/EditText01" android:id="#+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:enabled="false"></
EditText><CheckBox android:text="#+id/CheckBox03" android:id="#+id/
CheckBox03" android:layout_width="fill_parent"
android:layout_height="wrap_content">
</CheckBox>
<CheckBox android:text="#+id/CheckBox02" android:id="#+id/CheckBox02"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</CheckBox>
<CheckBox android:text="#+id/CheckBox01" android:id="#+id/CheckBox01"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:checked="true">
</CheckBox>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.seiservices.blending"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/
app_name">
<activity android:name=".Profile"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="8" />
</manifest>
It is not an error message, it is a warning. It means that (a task of) the application is running and that even though a 'startActivity' request was made to run that task, or another activity in the application. The system is just bringing the current task of that application to the foreground. (This can occur if you are running in Eclipse or AndroidStudio with the emulator.)
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.
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.
This happens if you run an app from eclipse without recompiling (recompilation will not be done if you have not changed the code) it doesn't go through the uninstall-install process, instead it pushes the application to the front just like you start application from Home Launcher. It's not an error but a 'working as intended'.
Regards
Project > Clean and then start your emulator again.
I found eclipse somehow got into a state where it was not building a new apk, even with code changes. Deleting the apk:
rm ./bin/"YOUR APP NAME".apk
and re-running your app from eclipse fixes the problem.
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.
On the emulator,
press "Home"
"Menu" button -> scroll through the list and select the app which you
are running
press "Force Stop".
This is warning It says app is already running..
I have solved it by recompiling my code and you can close your emulator and re run your app..
GoodLuck
Happy coding
Related
This question already has answers here:
App completely restarting when launched by icon press in launcher
(15 answers)
Closed 2 years ago.
As far as I know by default android app resumes when user clicks on its icon.
But for some reason my app (which I want to have the same behavior) restarts.
When I hold the home button and then select my app from "recent" I get it resumed.
I want the same behavior on clicking the app icon.
actually it's the same as https://groups.google.com/forum/?fromgroups=#!topic/android-developers/UjWcsFMe6ik
but they didn't find an answer
upd:
manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk a:minSdkVersion="10" a:targetSdkVersion="11"/>
<uses-permission a:name="android.permission.INTERNET"/>
<uses-permission a:name="android.permission.ACCESS_FINE_LOCATION"/>
<application a:label="#string/app_name"
a:theme="#android:style/Theme.NoTitleBar"
a:name="myapp.AppDelegate">
<activity a:name="myapp.activities.AuthorizationActivity"
a:label="#string/app_name"
a:screenOrientation="portrait"
a:alwaysRetainTaskState="true">
<intent-filter>
<action a:name="android.intent.action.MAIN"/>
<category a:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity a:name="myapp.activities.activity1"
a:screenOrientation="portrait"/>
<activity a:name="myapp.activities.activity2"
a:screenOrientation="portrait"/>
...
<activity a:name="myapp.activities.activityN"
a:screenOrientation="portrait"/>
<service a:name="myapp.location.LocationService"/>
</application>
It's all about IDE.
After closing an app which was started by IDE (eclipse or IDEA - doesn't matter) Android deletes all it's temporary data (don't ask me why)
So the solution is:
1) run app from ide (deploy it on device)
2) press back button to close an app
3) start an app again
...
and now it will resume working after quitting
Check launch mode of your activity. If its singleTask then make it standard and then check it.
Clicking the app icon will bring the task containing the main activity to the front.
To get the desired behavior make sure all your activities belong to the same task, i.e. don't use singleTask or singleInstance on any of the activities.
I've been having this problem for almost 2 months now and can't figure it out. The problem is that if my application is running and I run (reinstall) my application from Eclipse, I get an error message indicating that my application has crashed 'Unfortunately, has stopped.'. I notice that it also occurs when I run it away from my PC/Eclipse, I think that it happens only after I don't run it for a while.
It only occurs if the app is active in the 3rd activity (BaseDiagramActivity) and then I run the app again from Eclipse. I've stripped out basically all the application except the 3 activities and It's still happening.
I've searched and searched for a solution to this problem but can't find any good answer or one that applies to me.
It doesn't seem like a hardware or android version issue as I'm running this on my tablet (4.0.3) and my phone (4.0.2, was happening on 4.0.1 before update). Unless of course it is an ice cream sandwich bug.
Let me know if any more info is required.
The exception (Tag=AndroidRuntime)
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3938)
at android.app.ActivityThread.access$1300(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
... 11 more
The Android Code
LoadedApk.initializeJavaContextClassLoader() - Line 362 seems to be the offender
Below are the relevant files:
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="[my package]"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="HomeActivity"
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="LoadDiagramActivity" android:label="Load Diagram"></activity>
<activity android:name="BaseDiagramActivity" android:label="Base Diagram"></activity>
</application>
</manifest>
HomeActivity.java
public class HomeActivity extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
Button diagramButton = (Button)findViewById(R.id.diagram);
diagramButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(HomeActivity.this, LoadDiagramActivity.class));
}
});
}
}
LoadDiagramActivity.java
public class LoadDiagramActivity extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.load_diagram_menu, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
case R.id.add_new_diagram:
startActivity(new Intent(this, BaseDiagramActivity.class));
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
BaseDiagramActivity.java
it doesn't actually matter what activity this is, the exception occurs as long as a 'third' activity is started (or clicking the add button on LoadDiagramActivity.
public class BaseDiagramActivity extends Activity {
}
home.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="#+id/diagram"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Diagram" />
</LinearLayout>
Additional information
When I stripped down my project in order to ask a simpler answer, I moved everything into the package's namespace. In the actual project there are 5 namespaces, they were still present when I was testing with the stripped down version however just not called (as far as I could see).
Here are the packages:
[package] - general logic
[package].activities - all activities and base activities
[package].database - all interaction with the database
[package].models - models for saving/loading data
[package].renderables - objects drawn to a canvas
I have tried to add an `android:sharedUserId' attribute to the manifest and and it seemed to do nothing both times I tried. When I was initially investigating this I came to the conclusion that the shared user id only applied to different projects, not different packages.
Also I don't believe there was any interaction with the database when I stripped everything down. The fact that the 3rd activity could be any activity, even HomeActivity, was something against this theory.
Useful links
stackoverflow: android.app.Application cannot be instantiated due to NullPointerException
GreoCode android.app.LoadedApk on 4.0.1
Possible race condition?
Android issue #25869
Update 1/11/2012
Last couple of days I've jumped back into this project, I created a brand new project in Eclipse Juno (was on Helios before) and transferred everything over manually so that Eclipse and Android tools handled almost all of the Manifest interaction but it's still occurring. I will look at it a bit more over the next few days and update if I find anything.
FYI my new project is targeting the following:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
The new project structure also has all the activities in the root package now (ie. [package], not [package].activities). I'm also using the (new?) syntax to show the parent activity:
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="[my package].LoadDiagramActivity" />
It is also still occurring on my now updated Galaxy Nexus running Jellybean 4.1.2.
Try adding one more thing in Manifest file, I am sure you have already tried..
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="[my package]"
android:versionCode="1"
android:versionName="1.0"
android:sharedUserId="com.mj.app" >
It seems like in your project you have multiple PACKAGES, like com.package.p1 , com.package.p2 ,com.package.p3..
And while starting you are in p1 and then moves on to p2 - p3...
and at that time you try to run it again..so the Android gives you error.
If you put 13 in your minSdkVersion, it should work.
Either that, or you need to setDisplayHomeAsUpEnabled(false) in the onCreate() of your other activities.
Both those solutions should work.
Starting at API Level 14 according to the documentation, the setHomeButtonEnabled(true) is no longer done for you by default, and it goes on to say that
Setting the DISPLAY_HOME_AS_UP display option will automatically enable the home button.
So we can infer that setDisplayHomeAsUpEnabled(false) works in a similar way as setHomeButtonEnabled(false)
If I am not mistaken, this only happens when we reinstall the app from Eclipse Run->As. So this is unlikely to happen when a user upgrades through Play. I can say this with confidence since I did notice my app too with this exception during reinstall through Eclipse, but nothing on Crittercism.
To fix this, I worked on resolving memory consumption of my app.
If you only have 1 set of drawables, then change that. Create a drawables-mdpi and copy all the file from that 1 drawables folder (drawables, drawable-ldpi). If you have just 1 set, Android will resize it for its use on bigger screens, thus internally taking up too much memory, and cleanup of this kind of memory (bitmap) is bug prone. Sound crazy, but does wonders. Dont believe me, run it under Heap memory usage watch before and after this change, you will notice that your app is taking 25% less memory for a common scenario.
If you are doing any Bitmap operations, you may want to consider downscaling. Atleast when you are setting options you definitely want to downscale it. Check here and here. Search or downscaleing.
Finally dont forget to bitmap.recycle(); bitmap = null; in your onDestroy and before all System.exit(0).
Android does a lot of background work, and reinstallation is a abrupt cleanup expectation from the app. Memory not cleaned up can cause issues. This exception is one of those internal ones. So dont think of it to be straightforward.
You haven't added the period to the names of your activities in manifest's android:name attributes. Perhaps, this causes the problem.
Wait after your application crashes when u run it second time. The app will launch after the crashing again. This happens sometimes with me. If the same is the case with u dont forget to clean your project everytime before u run it.
By inspecting your code I feel you are skipping to set "setContentView(rid)" in LoadDiagramActivity. Please try setting the view in onCreate().
Hope this will help you.
You need to append "." before the activity name in Menifest.
Like this
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="14" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".HomeActivity"
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=".LoadDiagramActivity" android:label="Load Diagram"></activity>
<activity android:name=".BaseDiagramActivity" android:label="Base Diagram"></activity>
</application>
I update your menifest's activity. Please check it...
There is nothing wrong with the code you've given us so far. I just tried it in a new project with the package name com.test and it worked flawlessly. The only thing I added in the files were the package declaration. (And I added the load_diagram_menu.xml, of course.)
If possible, it would be great if you could give us access to the complete project. If the project is working on someone else's computer, it's most likely Eclipse or the Android Eclipse plugin-in that are misbehaving. A clean install of Eclipse would solve that. (Though I understand how being offline could make this difficult. :-) )
For this, be sure to have the "Build Automatically" checked when cleaning the project. (Project -> Build Automatically)
Thanks a ton to this site, I have made significant progress with my first Android project.
I'm trying to get the execution suspend in the onReceive() method of a boot completed receiver. Below are my manifest and receiver code.
Android 2.3.3
API - 10
IDE - Eclipse
Running on emulator
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.demo.notepad3" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application android:icon="#drawable/icon" >
<activity
android:label="#string/app_name"
android:name=".ProjectTrackerHomeActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ProjectTrackerEditActivity" />
<receiver android:name=".ProjectTrackerNotification" />
<receiver
android:name=".ProjectTrackerOnBootReceiver" >
<intent-filter >
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
Receiver:
public class ProjectTrackerOnBootReceiver extends BroadcastReceiver {
private ProjectTrackerDBAdapter mDbHelper;
#Override
public void onReceive(Context context, Intent intent) {
Debug.waitForDebugger();
AlarmManager
mgr=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
//I place the break point at line 2, the alarm manager line
// Further code, irrelevant
}
My observations -1. When I run this application in debug mode on eclipse, the break point is not even hit.2. When I run some other application in debug mode, this break point is hit momentarily! But before I can proceed with a step by step execution, the execution resumes. It doesn't stop there.
My reasoning for this behavior is that -1. When I run some other application, since this above app is already installed, it catches the boot complete broadcast and so the breakpoint is hit. (But why doesn't the execution halt at the breakpoint?)2. When I run only this app, it gets installed first and in the time it takes for installation, it misses the boot complete broadcast.
May I please get some assistance with the below queries -1. How can I make the execution halt at the breakpoint without it resuming further?2. Can I somehow run an already installed version of this app on the emulator in debug mode "without having it to get freshly installed" on the emulator every time I run it?
3. Is there anything else I'm doing wrong or missing something?
Kindly let me know since I really need to debug through onReceive() to catch further application logic bugs. Thanks a lot, folks.
You need to shutdown the phone and start it up to ever see onReceive get called from bootcompleted. To debug this, just add a Log statement in onReceive instead of setting a breakpoint. Otherwise, you'll have to add some action to the receiver in the manifest and then manually sendBroadcast(new Intent("someName")) with the name you specified in the receiver element in the manifest.
Not sure why this question is asked so many times and it was so hard to find the answer but this works like a champ for me.
In your receiver class within the onReceive() override add the below call for waitForDebugger() as the first call.
Deploy to the device by running the app.
Once the updated apk is on the device, reboot the device.
While device is rebooting return to your IDE (In this example Android Studio 1.4) and go to "Run" menu > "Attach debugger to Android Process".
Check "Show all processes".
Wait... Once the waitForDebugger() line is hit, your app/package will appear in this list. In my case, it took at least 2 minutes AFTER the device rebooted.
Click "OK", wait a moment and your breakpoint will be hit.
You can now step through your code like normal. Have fun!
#Override
public void onReceive(Context context, Intent intent) {
// Add this at beginning of method
android.os.Debug.waitForDebugger();
// Place breakpoint below
String myVariable = "Some Value";
}
Another method which I prefer as it means you do not need to keep restarting the device(boring, gradle takes long enough to load as it is), is to simply run the app in debug mode and then simulate an action which will call your Broadcast receiver using the following command in your terminal.
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -p com.example.package_name
The above creates a broadcast with action "BOOT_COMPLETE" and now you can debug without restarting.
Use the below line before the code where you want the debugger to stop:
android.os.Debug.waitForDebugger();
I have an application using the Google maps - until the moment it works fine. But now when I want to click a button in order to add functionality over the map I have problems.
I managed to visualise the button on the screen, also it works on click - it shows a toast correctly. But my aim is to start a new activity (having his own layout) - looking and reading tones of tutorials and stuff here is what I have :
//the Add Button in the upper right corner
Button addBookmark = (Button) findViewById(R.id.Button);
addBookmark.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick(View mapView) {
Intent addBookmarkIntent = new Intent(GoogleMapsApp.this, LocationBookmaker.class);
startActivity(addBookmarkIntent);
}
});
Also I've edited the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
...
<activity android:name=".LocationBookmarker"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
...
</manifest>
No matter what I try I always get the "The Application GoogleMapsApp (process google.maps.app) has stopped unexpectedly. Please try again." with the only "Force close" option.
I've been trying since two days now - and in a lot of examples in the Internet other say it should be working like this. I cannot see where could be my mistake.
Maybe in the starting of the intent, or the manifest or where...?
According to the exception, the class it's looking for is 'LocationBookmaker', but in your manifest you have 'LocationBookmarker' (notice the 'r'). That may be your problem.
I don't know what the problem you get is but a tip is to run the "Dalvik Debug Monitor" (ddms) on your computer, with that you can capture all exceptions in your application and see exaclly what the error is (most of the time).
You find the ddms in the tools directory of your android installation, if you run windows its a bat file, ddms.bat, that you just run from cmd.
/Viktor
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?
Warning: 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);
}
}
<EditText android:text="#+id/EditText01" android:id="#+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:enabled="false"></
EditText><CheckBox android:text="#+id/CheckBox03" android:id="#+id/
CheckBox03" android:layout_width="fill_parent"
android:layout_height="wrap_content">
</CheckBox>
<CheckBox android:text="#+id/CheckBox02" android:id="#+id/CheckBox02"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</CheckBox>
<CheckBox android:text="#+id/CheckBox01" android:id="#+id/CheckBox01"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:checked="true">
</CheckBox>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.seiservices.blending"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/
app_name">
<activity android:name=".Profile"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="8" />
</manifest>
It is not an error message, it is a warning. It means that (a task of) the application is running and that even though a 'startActivity' request was made to run that task, or another activity in the application. The system is just bringing the current task of that application to the foreground. (This can occur if you are running in Eclipse or AndroidStudio with the emulator.)
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.
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.
This happens if you run an app from eclipse without recompiling (recompilation will not be done if you have not changed the code) it doesn't go through the uninstall-install process, instead it pushes the application to the front just like you start application from Home Launcher. It's not an error but a 'working as intended'.
Regards
Project > Clean and then start your emulator again.
I found eclipse somehow got into a state where it was not building a new apk, even with code changes. Deleting the apk:
rm ./bin/"YOUR APP NAME".apk
and re-running your app from eclipse fixes the problem.
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.
On the emulator,
press "Home"
"Menu" button -> scroll through the list and select the app which you
are running
press "Force Stop".
This is warning It says app is already running..
I have solved it by recompiling my code and you can close your emulator and re run your app..
GoodLuck
Happy coding