How to stop android studio from running - android

How to I stop my code from running in Android Studio? I have tried selecting the program under the Java folder, but the "Terminate Application" button is grayed out. It's really annoying how the long is going crazy even though I have ended the app on my phone...
Here is a screenshot of my screen if it helps:

If you are referring to the lines in the logcat that keep appearing even when you app is stopped, this is normal, your phone keeps running other apps and logging status messages.
To suppress this output try selecting you application in the drop down menu on the right to show only your app's output

From this answer:
You need to select the process com.mycompany.myfirstapp and then press the Terminate Application button.

Related

Stop Android automatically restarting app after crash

On Android 9 the app crashes, the logs show up, but then the app restarts and the logs get lost. Is there any chance to disable this functionality and have it like it was pre 5.0 or whenever they added this functionality?
I can't see the crash because it clears the logs as it restarts. I'm going crazy !
Any solutions ?!
Nevermind. I found it ... there's a setting under Developer Options
"Always show crash dialog". So, so frustrating!
In Log table Change the value of top left Corner dropdown value from "Show only selected Application" to "No Fillter"
You can also find crash in run tab available at the bottom of android studio.

Logcat window clearing immediately on run

When I run my android app, the logcat window fills up and then clears. I have System.out.println()'s that aren't showing up, nothing is showing up and I have no idea why.
EDIT: Using Android Studio
I have had a lot of issues with logcat in Android Studio, so here's a few items:
In your run configuration (just to the left of the play button, select "Edit Configuration" from the drop-down, you can configure a couple of options related to logcat, including whether or not Android Studio will clear it on startup
If the debugger disconnects you will lose your connection to the logcat. (some kinds of errors seem to force disconnect the debugger. I'm not entirely sure why.)
If you never clear your logcat, then Android Studio will attempt to display the entire logcat since the last time you restarted the device/emulator. This can take a long time, and may display a blank screen while it's processing.
By default, Android Studio will try to filter out messages unrelated to your app. In my experience, this never works right. I think it's easier to search for the tag that you're looking for.
I haven't specifically tried System.out.println() in Android Studio, but the typical Android way to print debug messages is with Log.d. Log
is located in android.util.Log. Android Studio will import it automatically if you type Log and press alt+enter.
My guess would be that your problem isn't that it's clearing logcat, but that it's not clearing logcat and Android Studio is choking on too large of a log file. Either select auto-clearing from the run configuration window or try walking away for a few minutes and see if the logcat ever comes back

Regarding improper functionality of emulator in android studio

i am new here, but i checked the site, it does not contain my question, hence not duplicate. Actually, in my android studio v 1.1.0, emulator does not launch default activity automatically when started in android studio. What i mean is that when i click the green (play) button to run my project, my emulator is launched. When it loads and is ready to be unlocked, after unlocking my default activity should run automatically but it does not. Just The Home screen is shown no matter how much i keep waiting. No error reported in LogCat, neither any exception or anything wrong with code. So to run, I have to right click on my activity and click run MainActivity from the available options. So, how do i make the emulator automatically launch my default activity?

Application restarting after installing from SDCard and putting it on Background

I've created a sample application (just a textview, nothing else), and I noticed a bug.
After installing it from the SDCard, it displays the "Application installed" screen, with the done and open buttons.
If I click the open button, a strange thing occurs:
Whenever I put the application in background and reopen it from the application icon, it doesn't reopen it, it creates a new instance.
I can confirm that it is creating a new instance, because after putting it on background and reopening a few times, when I click the back button, it opens the previous instance, instead of returning to the home screen.
Now the strange thing is that it only happens after installing from the SDCard and clicking on the open button.
If I click the done button (or installing via ADB) and open the application via icon, it doesn't happen.
Also, if I click the open button (and the bug occurs), after the application is ended for the first time, the bug doesn't occurs anymore.
I've tested it in different devices and in different Android versions (GB, HC and ICS), and the bug is reproducing in them all.
Does someone know if this is an known issue from Android and if so, does someone have an official reference that I can refer?
Thanks in advance
Yep, it is a nasty, well-known Android bug that has been around since the very beginning. See the following:
Android issue 26658
Android issue 2373
Android app acts differently installed from adb vs sdcard

Android: How to stop emulation

I'm coming from Visual studio and C# and am new to Android (and eclipse) so quite ignorant of basic functionality.
I've written a short app and ran it under the emulator. No problems.
Now I've made some changes and want to test them. In VS I'd stop the application debug run before making code changes, and after the code changes run again.
I can't find the 'stop' debug button in eclipse. How do I run my app after I've made changes?
What you can do is press the [Escape] key on your keyboard or the 'Back' button within the Emulator to close your app then rebuild and run it in Eclipse, which should bring it up as active in the Emulator.
You can just run it again and the code changes will apply.
But else you'll find it under the Debug-window (Window->Show View->Debug) and there is a "terminate" button in the top right corner of your screen.
You might need to close the app inside the emulator though..
There is deference between just running the application and debugging, you can pres play in ellipse and that will run the app but what you can also do is to switch the perspective in debug view (to switch go to the right top corner, and change from java to debug perspective)
in debug mode you can also set break points, just like in visual studio the only difference here is you must change perspective

Categories

Resources