title: Cannot Resolve Method getContext() in Android
body: <p>I am trying to implement GCM Push notification and try to get Android emulator id, and add the following code, but it shows me the following error. I cam relatively new on this platform.  </p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          String android_id= Settings.Secure.getString(getContext().getContentResolver(), Settings.Secure.ANDROID_ID);
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/G79d1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/G79d1.png" alt="enter image description here"></a></p>