title: Empty RecyclerView using fetched Data from parse.com
body: <p>I am currently struggling to implement data <code>fetching</code> from a <code>class</code> i created on <code>parse.com</code>. I wanted to retrieve an object which is entitled <strong>"flyerDataFetch</strong>" and all of its elements to display within a <code>Recyclerview</code>.</p>
  
  <p>When I run and compile the program I receive the errors: </p>
  
  <pre><code>error:java.lang.NullPointerException at android.view.LayoutInflater.from(LayoutInflater.java:211) 
  Error: RecyclerView﹕ No adapter attached; skipping layout. 
  </code></pre>
  
  <p><em>Can you please review my code and help identify where I went wrong in the process of trying to populate my <code>RecyclerView</code>?</em> </p>
  
  <p><code>MainActivity</code>:</p>
  
  <pre><code>public class HomeScreen extends AppCompatActivity {
      private RecyclerView mRecyclerDrawer;
      private customAdapter mAdapter;
      private Context context;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home_screen);
          setupDrawer();
          final List&lt;Information&gt; data = new ArrayList&lt;&gt;();
          Parse.initialize(this, "xxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxx");
          ParseQuery&lt;ParseObject&gt; query = ParseQuery.getQuery("flyerDataFetch");
          query.getInBackground("xWMyZ4YEGZ", new GetCallback&lt;ParseObject&gt;() {
              @Override
              public void done(ParseObject parseObject, com.parse.ParseException e) {
                  if (e == null) {
  
                      Information information = new Information();
                      information.partyName = parseObject.getString("partyName");
                      information.partyPromoterName = parseObject.getString("partyCost");
                      information.partyCost = parseObject.getString("partyName");
  
                      information.flyerPic = parseObject.getParseFile("partyFlyerImage");
                      information.partyPromoterPic = parseObject.getParseFile("partyPromoterImage");
  
                      data.add(information);
                  } else {
                      // something went wrong
                  }
                  mRecyclerDrawer = (RecyclerView) findViewById(R.id.drawerList);
                  mRecyclerDrawer.setLayoutManager(new LinearLayoutManager(context));
                  mAdapter = new customAdapter(context, data);
                  mRecyclerDrawer.setAdapter(mAdapter);
              }
          });
  
      }
  </code></pre>
  
  <p><code>MyApplication</code>:</p>
  
  <pre><code> @Override
      public void onCreate() {
          super.onCreate();
          sInstance = this;
          ParseCrashReporting.enable(this);
          Parse.enableLocalDatastore(this);
          Parse.initialize(this, "xxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxx");
      }
  </code></pre>
  
  <p><code>CustomAdapter</code>:</p>
  
  <pre><code>package com.example.jbobo_000.prac;
  import android.content.Context;
  import android.content.Intent;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.parse.ParseImageView;
  
  import java.util.Collections;
  import java.util.List;
  
  public class customAdapter extends RecyclerView.Adapter&lt;customAdapter.MyViewHolder&gt; {
      List&lt;Information&gt; data = Collections.emptyList();
      private LayoutInflater inflater;
      private Context context;
      public customAdapter (Context context,List&lt;Information&gt;data){
          this.context=context;
          inflater=LayoutInflater.from(context);
          this.data= data;
      }
  
     @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
         View view= inflater.inflate(R.layout.custom_row, parent, false);
         MyViewHolder holder = new MyViewHolder(view);
         return holder;
     }
  
      @Override
      public void onBindViewHolder(MyViewHolder holder,int position){
          Information current= data.get(position);
          holder.promoterNameText.setText(current.partyPromoterName);
          holder.costText.setText(current.partyCost);
          holder.partyNameText.setText(current.partyName);
          holder.flyerImage.setParseFile(current.flyerPic);
          holder.promoterImage.setParseFile(current.partyPromoterPic);
      }
  
      @Override
      public int getItemCount(){
  
          return data.size();
      }
  
  
      class MyViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
          TextView promoterNameText;
          TextView costText;
          TextView partyNameText;
          ParseImageView flyerImage;
          ParseImageView promoterImage;
  
          public MyViewHolder(View itemView) {
              super(itemView);
              itemView.setOnClickListener(this);
              promoterImage = (ParseImageView) itemView.findViewById(R.id.promoterPicImage);
              flyerImage = (ParseImageView) itemView.findViewById(R.id.flyertImage);
              costText = (TextView) itemView.findViewById(R.id.costText);
              promoterNameText = (TextView) itemView.findViewById(R.id.promoterNameText);
              partyNameText = (TextView) itemView.findViewById(R.id.partyNameText);
          }
  
          @Override
          public void onClick(View v) {
              context.startActivity(new Intent(context, partyInformation.class));
  
          }
      }
  }
  </code></pre>
  
  <p><code>Information</code>:</p>
  
  <pre><code>package com.example.jbobo_000.prac;
  import com.parse.ParseFile;
  import com.parse.ParseImageView;
  
  public class Information {
      public ParseFile flyerPic;
      public ParseFile partyPromoterPic;
      public String partyCost;
      public String partyName;
      public String partyPromoterName;
  
  
  
  }
  </code></pre>
  
  <p><code>Logcat</code>:</p>
  
  <pre><code>06-12 01:52:37.511    5432-5432/com.example.jbobo_000.prac E/RecyclerView﹕ No adapter attached; skipping layout
  06-12 01:52:37.766    5432-5432/com.example.jbobo_000.prac D/AndroidRuntime﹕ Shutting down VM
  06-12 01:52:37.766    5432-5432/com.example.jbobo_000.prac E/CrashReporting﹕ ParseCrashReporting caught a NullPointerException exception for com.example.jbobo_000.prac. Building report.
  06-12 01:52:37.768    5432-5432/com.example.jbobo_000.prac E/CrashReporting﹕ Handling exception for crash
      java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
              at android.view.LayoutInflater.from(LayoutInflater.java:219)
              at com.example.jbobo_000.prac.customAdapter.&lt;init&gt;(customAdapter.java:25)
              at com.example.jbobo_000.prac.HomeScreen$1.done(HomeScreen.java:57)
              at com.example.jbobo_000.prac.HomeScreen$1.done(HomeScreen.java:38)
              at com.parse.ParseTaskUtils$2$1.run(ParseTaskUtils.java:107)
              at android.os.Handler.handleCallback(Handler.java:739)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5254)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  06-12 01:52:37.768    5432-5432/com.example.jbobo_000.prac D/CrashReporting﹕ Generating report file for crash
  06-12 01:52:37.843    5432-5432/com.example.jbobo_000.prac D/CrashReporting﹕ Retrieving logcat output...
  06-12 01:52:37.871    5432-5432/com.example.jbobo_000.prac D/CrashReporting﹕ Retrieving logcat output...
  06-12 01:52:37.889    5432-5432/com.example.jbobo_000.prac D/CrashReporting﹕ Retrieving logcat output...
  06-12 01:52:37.965    5432-5432/com.example.jbobo_000.prac W/Settings﹕ Setting stay_on_always has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
  06-12 01:52:38.164    5432-5432/com.example.jbobo_000.prac V/CrashReporting﹕ About to start ReportSenderWorker from #handleException
  06-12 01:52:38.172    5432-5603/com.example.jbobo_000.prac D/CrashReporting﹕ #checkAndSendReports - start
  06-12 01:52:38.172    5432-5603/com.example.jbobo_000.prac D/CrashReporting﹕ Looking for error files in /data/data/com.example.jbobo_000.prac/files/com.parse/cr/reports
  06-12 01:52:38.175    5432-5603/com.example.jbobo_000.prac D/CrashReporting﹕ Loading file 1434088357768-NullPointerException-1.stacktrace
  06-12 01:52:38.185    5432-5603/com.example.jbobo_000.prac I/CrashReporting﹕ Sending file 1434088357768-NullPointerException-1.stacktrace
  06-12 01:52:38.186    5432-5603/com.example.jbobo_000.prac D/CrashReporting﹕ Sending crash report to Parse...
  06-12 01:52:38.193    5432-5603/com.example.jbobo_000.prac D/CrashReporting﹕ #checkAndSendReports - finish
  06-12 01:52:38.265    5432-5432/com.example.jbobo_000.prac E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.example.jbobo_000.prac, PID: 5432
      java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
              at android.view.LayoutInflater.from(LayoutInflater.java:219)
              at com.example.jbobo_000.prac.customAdapter.&lt;init&gt;(customAdapter.java:25)
              at com.example.jbobo_000.prac.HomeScreen$1.done(HomeScreen.java:57)
              at com.example.jbobo_000.prac.HomeScreen$1.done(HomeScreen.java:38)
              at com.parse.ParseTaskUtils$2$1.run(ParseTaskUtils.java:107)
              at android.os.Handler.handleCallback(Handler.java:739)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5254)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  06-12 01:52:38.291    5432-5442/com.example.jbobo_000.prac W/art﹕ Suspending all threads took: 5.494ms
  </code></pre>