title: Cannot access 'TAG': it is invisible (private in supertype) in 'AppCompatActivity'
body: <p>I am a beginner in android programming. I'm currently using android studio 3.2.1.
  I am trying to monitor the different states of an android activity in log. I have written the code shown below, but I keep receiving the error message: </p>
  
  <blockquote>
    <p>Cannot access 'TAG': it is invisible (private in supertype) in 'AppCompatActivity'.</p>
  </blockquote>
  
  <p>Even after searching, I cannot figure the error. Can some one help?
  Code:</p>
  
  <hr>
  
  <pre><code>package com.cooperation.bestech.test1
  
  import android.support.v7.app.AppCompatActivity
  import android.os.Bundle
  import android.util.Log;
  
  class MainActivity : AppCompatActivity() {
       private static final String TAG = "MyMessage";
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          Log.i(TAG, "onCreate");
      }
  
      override fun onStart() {
          super.onStart()
          Log.i(TAG, "onStart");
      }
  
      override fun onPause() {
          super.onPause()
          Log.i(TAG, "onPause");
      }
  
      override fun onResume() {
          super.onResume()
          Log.i(TAG, "onResume");
      }
  
      override fun onStop() {
          super.onStop()
          Log.i(TAG, "onStop");
      }
  
      override fun onRestart() {
          super.onRestart()
          Log.i(TAG, "onRestart");
      }
  
      override fun onDestroy() {
          super.onDestroy()
          Log.i(TAG, "onDestroy");
      }
  
      override fun onSaveInstanceState(outState: Bundle?) {
          super.onSaveInstanceState(outState)
          Log.i(TAG, "onSaveInstanceState");
      }
  
      override fun onRestoreInstanceState(savedInstanceState: Bundle?) {
          super.onRestoreInstanceState(savedInstanceState)
          Log.i(TAG, "onRestoreInstanceState");
      }
  }
  </code></pre>