Different States of an Android Activity

+122 Bucky Roberts · December 19, 2014

   protected void onStart() {
       Log.i(TAG, "onStart");

   protected void onResume() {
       Log.i(TAG, "onResume");

   protected void onPause() {
       Log.i(TAG, "onPause");

   protected void onStop() {
       Log.i(TAG, "onStop");

   protected void onRestart() {
       Log.i(TAG, "onRestart");

   protected void onDestroy() {
       Log.i(TAG, "onDestroy");

   protected void onSaveInstanceState(Bundle outState) {
       Log.i(TAG, "onSaveInstanceState");

   protected void onRestoreInstanceState(Bundle savedInstanceState) {
       Log.i(TAG, "onRestoreInstanceState");

Post a Reply


- page 4
Oldest  Newest  Rating
0 Direndra Subba · January 14, 2016
???protected void onStart() {
???????Log.i(TAG, "onStart");

Why i get this (?) symbol in the code? 
0 nishanth somashekar · July 30, 2015
thanks bucky
0 Oleg Zigalenko · April 15, 2015
Hi Shreyans Mulkutkar. I had a similar problem and I could not see the log messages. After doing a little research this is what worked for me: 

-Change Log Level from Verbose to Debug
-Change Log Level from Debug to Verbose (basically it just resets it)
  (Make sure that your filter is set to your correct name that you created)
-Then click the Restart button on the left side of the log window (looks like a gray box with green arrow)
It will restart the log and wait about 10 seconds and it should show up. 

If it still does not work then please look at this link as it has more solutions to the same problem. 


Good luck and happy coding. 
0 sandip ghoshal · July 24, 2015
i am having problem with android avd manager i can not open emulator the android virtual device i am new in this this following error i am getting

D:\Users\sandip\AppData\Local\Android\sdk\tools\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_22
Creating filesystem with parameters:
WARNING: userdata image already in use, changes will not persist!
Size: 69206016
WARNING: cache image already in use, changes will not persist!
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Blocks: 16896
WARNING: SD Card image already in use: D:\Users\sandip\.android\avd\Nexus_5_API_22.avd/sdcard.img
Block groups: 1
Reserved block group size: 7
Created filesystem with 11/4224 inodes and 1302/16896 blocks
emulator: WARNING: Requested RAM size of 512MB is too large for your environment, and is reduced to 384MB.
emulator: device fd:600
HAX is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD RAM size = 384 MB
emulator: HAXM max RAM size = 0 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.
creating window 43 59 329 583
emulator: emulator window was out of view and was recentered
0 Sandesh uttarwar · June 14, 2015
thank you for this...!
0 taha almasri · August 25, 2015
can u help me please :(
0 Rogy Joseph · September 15, 2015
Thank you Bucky for the fantastic explanation.
0 nathan abraham · May 17, 2016
How do you find the source codes for all the videos I can't find the on this website plz help

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator