title: Cannot call RecycleView from other activity
body: <p>My RecycleView is in my Activity and then I want to set it in my other class. But it always say <strong>NullObjectReference</strong> with my RecycleView. I dont know why because i have initialize it. Is there something wrong? Here is my code</p>
  <p><strong>My Activity</strong></p>
  <pre><code>public class MainActivity extends AppCompatActivity implements View.OnClickListener {
  
  RecyclerView recyclerView;
  VolleyGet volleyGet;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      initRecycle();
      volleyGet = new VolleyGet();
      RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
      recyclerView.setLayoutManager(mLayoutManager);
      
      Button get = (Button) findViewById(R.id.get);
      get.setOnClickListener(this);
  
  }
  
  public void initRecycle(){
      recyclerView = findViewById(R.id.recycleview);
  }
  
  @Override
  public void onClick(View v) {
      switch (v.getId()) {
  
          case R.id.get:
              volleyGet.volleyRequest(this);
              break;
              
          default:
              break;
      }
  }
  </code></pre>
  <p><strong>My Other Class</strong> (RecycleView must be set here)</p>
  <pre><code>public class VolleyGet {
  RecyclerView recyclerView;
  public RecycleAdapter adapter;
  public ArrayList&lt;User&gt; listUser;
  
  public void volleyRequest(final Context context) {
      MainActivity mainActivity = new MainActivity();
      mainActivity.initRecycle();
      listUser = new ArrayList&lt;&gt;();
      adapter = new RecycleAdapter(context, listUser);
      
      String URL = &quot;http://192.168.180.7:8080/get.php&quot;;
      RequestQueue queue = Volley.newRequestQueue(context);
      StringRequest stringRequest = new StringRequest(Request.Method.GET, URL,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      try {
                          JSONArray array = new JSONArray(response);
                          for (int i = 0; i &lt; array.length(); i++) {
                              ArrayList&lt;User&gt; items = new Gson().fromJson(response.toString(), new TypeToken&lt;ArrayList&lt;User&gt;&gt;() {
                              }.getType());
                              listUser.clear();
                              listUser.addAll(items);
                          }
                          recyclerView.setAdapter(adapter);
                          
                      } catch (JSONException e) { e.printStackTrace(); } }},
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) { }}) {};
      queue.add(stringRequest);
  }
  </code></pre>