I know there is an option to "force stop running application before launching activity" (which I do have enabled) but I'm after a way to have the same program exit as soon as I click the "play" button. I believe this is what use to happen before an upgrade but ever since the upgrade I've been unable to find a way to do it.
The reason I'm after this is because before (when the app closed when I pressed the button) it was really easy to tell when the new edit of my app was up and running on the device. Now that the old version keeps running I frequently make mistakes thinking the new version is already running before it is, or more commonly, not realising the new version is ready thinking the version I am looking at is the old one.
Is there a way to bring back the behaviour I seem to remember having before?
Thanks.
You can disable Instant Run via Settings -> Build, Execution, Deployment in Android Studio
Disable the Instant Run option from Settings as follows:
I think check thd delendencues and any error code written in any java as well as manifest file of application . I have done and my app is running.
Related
I am new to Android and building an app in Android Studio. I have written some tests using JUnit and Mockito.
The tests run successfully and in the run console the text Process finished with exit code 0 is shown.
However, the thread seems to remain active, the stop button is enabled and nothing happens even if I click on it. If I try to start multiple test configurations, they all remain active although the processes finish successfully.
I hope the question is clear enough... I have searched a lot for the answer and mananged to find nothing.
That can be fixed by following these steps:
Open 'Run' tab in Android Studio
Tap 'X' next to test which has just passed
Ok, so after a little more research and some more checking I have concluded that the problem stands in a visual bug of Android Studio. Apparently the tests do indeed stop, the thread running them too. The problem is purely visual.
In my program's any activity ,I press the home button,and then in desktop press my app's icon,I saw the launch activity,not before activity.What happen on my app?
And I found if I use Android Studio run without sign,the app is run normally.A month ago,I move the codes from eclipse to AS,on eclipse IDE not found this problem.Can anybody help me? Very thx.
Maybe grammar errors,sorry.
EDIT:I found this is an Android bug https://code.google.com/p/android/issues/detail?id=26658
And the solution is https://code.google.com/p/android/issues/detail?id=26658#c14
If you are working on real device, make sure you didn't set the flag
Don't keep activities in Developer options.
On emulator check in running configurations that you launch the default activity.
On manifest check that you do not exclude your activities from recent.
I wrote an application using Phonegap on Android and ran it directly from Eclipse on my mobile device (Android). exit on suspend config was true.
Now I want to update the application and I'm not able to do that since each time I run the application from Eclipse (to be ran on my device) I get the old version since each time I exit the application it gets suspended and then resumed when launched again.
The update is critical as there are some database information that I need and I'm not able to use the code I wrote to get the information needed since the application is not getting updated on the mobile (it's resuming all the time).
What can be done to force an update to the application without losing the database (SQLite)? I changed the config.xml and turned off exit-on-suspend but it's not doing anything since Cordova is always detecting the previous (suspended) version.
I tried killing the running applications, restarting both the mobile phone and eclipse and adb but that didn't work out.
Is it possible to uninstall the application and install it again without losing the database? If not, how do I updated the application?
Thank you.
EDIT: Typos.
I think the new value (per Cordova 3.3) may be:
<preference name="KeepRunning" value="true"/>.
This is coming really, really late but it might help others...
Just simply Cleaning the project before Running the application by doing the following;
Go to Project Menu
Then click on Clean
Select the current project you are working on and click on Ok
That will clean you project but will not uninstall it and your new updates will be implemented.
Hope it helps, cheers!!!
STEPS-TAKEN: Not sure what the source of the problem is, but the quick description of the bug is that:
I install all required software, SDKs, configs,
Then create two new projects each using the tabbed-window template, each of which support deployment to Android.
Then I run one project via Titanium Studio's Run option, let the Android Emulator load, and confirm it's the app is installed an working.
Then I closed the emulator, and then run the other project the same way as the last, though when the app is shown on the screen it has the name of the first app, not the app run.
FIXES-TRIED: I've attempt executing "Project >> Clean" for all projects before the second run, and still get the same "bug".
SETUP: To my knowledge all of my configs are correct, and clearly the build "works" though it is very possible there is something wrong with my installation build chain to get to the point I'm running the app in Titanium Studio via the Android Emulator.
ERRORS: I've reviewed the console output for FastDev, AppInstall, Android-Emulator, etc and have seen no error messages that jump out; meaning I have seen no error messages, except for build.py error after the first script runs saying it didn't find the script running on a port when it attempt to kill it; given the request is to kill itself, and it's not found, I just assume this is a confusing way of saying the script did what it was suppose to do.
Current build: is on Windows-XP-SP3 using TiStudio 2.0.1 build, JavaSDK 1.6, r18-Android, and Android-2.2
Recent emulators have persistent state, so your second launch probably gets back the system you were running before.
You should not have to resort to this on a regular basis unless something is broken in the workflow, but deleting the AVD and making a new one should get you a clean slate.
I believe there is also a startup flag to the emulator which tells it not to use the checkpoint from a previous run, but start from scratch - you could try to change your configuration to use that flag.
A downside to either deleting or forgoing checkpoints is that the emulator will take longer to start up.
Really though, you are supposed to be able to re-install or launch a given application, or install a completely different one, all within the same running of an emulator. You aren't supposed to need a new emulator, any more than you need to go buy a new device (or perform a factory reset on it). So something is not right in the setup, and the best solution for long term productivity is to identify and fix that. Short term of course, you might need to wipe the slate clean if that helps you meet today's deadline.
I'm having a troubling problem testing some code for and Android app. My app has two parts, and activity where the user changes some settings, and a broadcast receiver that responds to SMS messages, both in the same package.
Here's the problem, I first implemented some simple code to test out the broadcast receiver and the activity, and both worked fine. But then as I tried to refine the code, I noticed the emulator wasn't picking up any of my changes. Event went so far as to uninstall the app from the emulator and try again, no luck. Then I added some extra Toast popups to my receiver, nothing, still running the old code. I know its running the old code because its sending out an SMS using a string constant that is no longer in the current code, so it should be impossible that it respond with that value.
Here's the kicker that has me confused. For fun I made a change to my activity. Ran the project from Eclipse and that change showed up! Tried to test the receiver code again, runs the old code that doesn't even exist anymore!!
How in the world can half the package update, and the other half not?
Can anyone help me out 'cause I'm about ready to lose my mind.
I had a similar problem. Changes made to classes imported from another project didn't get picked up by eclipse, but those made to classes in the current android project were.
Making a change to the current android project (inserting a blank line and deleting it) seemed to make eclipse pick up all the changes made and upload the app to the emulator.
I had this problem too, Now I found a working solution. Just follow these steps:
Run your project normally.
When emulator started, run your project again (DO NOT close the first emulator)
Then the updated application will be uploaded into emulator
I can't really be sure what happened but creating an new emulator image appeared to solve the issue.
I don't know why it happens but it's a problem I have all the time.
What I typically do is
Close the emulator
Close Eclipse
Reopen Eclipse
Clean the projects (in Eclipse, select Project -> Clean... -> Clean all projects)
Rerun the emulator
Annoying as hell but seems to work for me.
I'm having this problem too. It mostly happens when errors are entered into the code. The strange thing is if I go back to the original code, Eclipse doesn't revert to the original code. One thing that seems to help is to temporary delete the contents of a file, save, and rebuild, and then enter the contents back into the file, save, and rebuild.
How is one supposed to debug in such an environment?