Use this.getClass().getSimpleName() to get the name of the Activity.
From the comments, if you’re in the context of an OnClickListener (or other inner class), specify the class manually:
MainActivity.class.getSimpleName()
Use this.getClass().getSimpleName() to get the name of the Activity.
From the comments, if you’re in the context of an OnClickListener (or other inner class), specify the class manually:
MainActivity.class.getSimpleName()