'TAG' has private access in 'android.support.v4.app.FragmentActivity'

后端 未结 4 2087
北荒
北荒 2021-02-05 04:44

Almost everything in my activity is working fine, except for wherever TAG is referenced. TAG gets a red line and says: \'TAG\' has private access

4条回答
  •  迷失自我
    2021-02-05 04:53

    Practical note: following is the better approach

    private static final String TAG = MainActivity.class.getSimpleName();
    

    as compared to:

    private static final String TAG = "MainActivity";
    

提交回复
热议问题