-
-
Save anonymous/8f1c6e624a5374a51dac6d5b1e58cae6 to your computer and use it in GitHub Desktop.
package com.example.android.lifecycle; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Log.v("MainActivity", "onCreate"); | |
} | |
@Override | |
protected void onStart() { | |
super.onStart(); | |
Log.v("MainActivity", "onStart"); | |
} | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
Log.v("MainActivity", "onResume"); | |
} | |
@Override | |
protected void onPause() { | |
super.onPause(); | |
Log.v("MainActivity", "onPause"); | |
} | |
@Override | |
protected void onStop() { | |
super.onStop(); | |
Log.v("MainActivity", "onStop"); | |
} | |
@Override | |
protected void onDestroy() { | |
super.onDestroy(); | |
Log.v("MainActivity", "onDestroy"); | |
} | |
} |
it must be showing something at least if not logcat..what its showing>???
Check if your package name is okay or any red error indication.
You should see this first three logs:
02-24 16:32:07.377 31979-31979/com.example.android.activitylifecycle V/MainActivity: onCreate
02-24 16:32:07.378 31979-31979/com.example.android.activitylifecycle V/MainActivity: onStart
02-24 16:32:07.380 31979-31979/com.example.android.activitylifecycle V/MainActivity: onResume
Hope you fixed it :)
@ebnrdwan there must be something displayed on the logcat. Try re-running.
@ebnrdwan sometimes Android Studio does that. Restarting the studio helped me several times.
Hope this helps.
Helpful
Thanks
use log.i
Works fine with log.v
use logo
It's work, i try it, thanks devemoper
Nice!!!!
Thanks
thank you :)
I WAS HERE......
And also, don't disable logging in develeper option on phone
Lol! learning this course in 2021!
doesn't appear any thing on the logcat !! ?
any hint to solve this ?