title: cannot find symbol method getcontext
body: <p>I am new to android/java programming and I am having an issue with getting an error saying that the symbol <code>getContext</code> cannot be resolved. That system is start with <code>Activity</code> there are two <code>fragment</code>. The one is button for show Rest Api. Please help</p>
  
  <p><strong>InstansiActivity.java</strong>:</p>
  
  <pre><code>package com.example.instansi;
  
  
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.lifecycle.Observer;
  import androidx.lifecycle.ViewModelProvider;
  import androidx.recyclerview.widget.GridLayoutManager;
  import androidx.recyclerview.widget.RecyclerView;
  
  import android.os.Bundle;
  
  
  import com.example.instansi.adapter.InstansiAdapter;
  import com.example.instansi.model.DaftarInstansiItem;
  
  import java.util.ArrayList;
  
  public class InstansiActivity extends AppCompatActivity {
      private InstansiAdapter instansiAdapter;
      private RecyclerView rvInstansi;
      private com.example.instansi.viewmodel.InstansiViewModel instansiViewModel;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_instansi);
  
          instansiAdapter= new InstansiAdapter(getContext());
          instansiAdapter.notifyDataSetChanged();
  
          rvInstansi= view.findViewById(R.id.finstansi_rv);
          rvInstansi.setLayoutManager(new GridLayoutManager(getContext(),1));
  
          instansiViewModel= new ViewModelProvider(this).get(com.example.instansi.viewmodel.InstansiViewModel.class);
          instansiViewModel.setInstansi();
          instansiViewModel.getInstansi().observe(this, getInstansi_);
  
          rvInstansi.setAdapter(instansiAdapter);
      }
  
  
      private Observer&lt;ArrayList&lt;DaftarInstansiItem&gt;&gt; getInstansi_ = new Observer&lt;ArrayList&lt;DaftarInstansiItem&gt;&gt;() {
          @Override
          public void onChanged(ArrayList&lt;DaftarInstansiItem&gt; daftarInstansiItems) {
              if (daftarInstansiItems != null) {
                  instansiAdapter.setData(daftarInstansiItems);
              }
          }
      };
  }
  </code></pre>