I am learning to use Android Studio in OSX Catalina 10.15.3 and as per a tutorial to identify which state my app is running currently I wrote the following in MainActivity.java '
package com.example.learn;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
private static final String TAG="My Message";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.i(TAG,"onCreate");
}
@Override
protected void onStart() {
super.onStart();
Log.i(TAG,"onStart");
}
@Override
protected void onResume() {
super.onResume();
Log.i(TAG,"onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.i(TAG,"onPause");
}
@Override
protected void onRestart() {
super.onRestart();
Log.i(TAG,"onRestart");
}
@Override
protected void onStop() {
super.onStop();
Log.i(TAG,"onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i(TAG,"onDestroy");
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
Log.i(TAG,"onSaveInstanceState");
}
@Override
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
Log.i(TAG,"onRestoreInstanceState");
}
}
Then I added a logcat filter and this is the screenshot of my filter. MY FILTER'S SCREENSHOT
But I am not getting any output in my logcat after applying the filter, I have checked the emulator on which I am running my app and it is same as in the logcat. My app is running successfully and logcat is also showing a lot of things before applying the filter, but after applying the filter it is blank.