Auto-generate Android Log TAG in Android Studio/Intellij idea
Solution 1:
I find a solution
1) Create a new live template in plain group
2) In template text :
private static final String TAG = $CLASS_NAME$.class.getSimpleName();
3) Define a usage scope :
4) Choose a shortcut :
finally click on Edit variables and change expression value to className()
Click Ok , Apply, Ok and use.
Solution 2:
There already exists such shortcut in Android Studio - write logt and enter while cursor is at the class scope.
more here :
Solution 3:
It's super simple in Android studio, just type logt
and press Tab.
It generates: private static final String TAG = "xyzActivity";