title: NullPointerException when Navigating from AppWidget to Activity via PendingIntent
body: <p>Ok i have been having this issue for a while now and i seem to be missing something. I have an appwidget which i update periodically via a service and in that appwidget, i navigate to an activity through a PendingIntent. 
   so in my appwidget, i have this:</p>
  
  <p>in MyService class:</p>
  
  <pre><code>PerformMethod();
  
       /*do some other operations*/
  
      /*Display Forecast Details View*/
      Intent myactivity = new Intent(this,MyActivity.class );
      myactivity.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
  
      /*Utilising pendingIntent class to get Activity*/
      PendingIntent myactivityIntent = PendingIntent.getActivity(this, 0, myactivity, PendingIntent.FLAG_CANCEL_CURRENT);
  
      /*Listener and updating appWidget through remote Views*/
      remoteView.setOnClickPendingIntent(R.id.settings_image_id, myactivityintent);
  
  
      public void PerformMethod(){
  
       dataset = MyDataSet.getDataSet();
        dataset.getDetails.clear();  // clear to get fresh values 
  
        details = new Details();
  
        dataset.setDetails(details);
  
        //perform other operations with details and add to the dataset.
      }
  </code></pre>
  
  <p>MyDataSet class:</p>
  
  <pre><code> MyDataSet dataset; 
  
            private DataSet(){
  
      }
  
      public static synchronized MyDataSet getDataSet(){
          if(dataset == null){            
              dataset = new MyDataSet();
          }
          return dataset;
      }
  
      private ArrayList&lt;Details&gt; mydetails = new ArrayList&lt;Details&gt;(5);
  
          public void setDetails(Details details) {
          this.mydetails = details;   
      }
  
      public Details getDetails(){
          return mydetails;
      }
  </code></pre>
  
  <p>MyActivity:</p>
  
  <pre><code>MyDataSet dataset;
      @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Log.d(TAG, "on create of fragment activity");
      setContentView(R.layout.details_item_layout);
  
      dataset = MyDataSet.getDataSet();
      int count = dataset.getDetails.size();   // NullPointerException here
  }
  </code></pre>
  
  <p>Now the issue is sometimes when i navigate to MyActivity from the appwidget, i get the values and sometimes i get Null. when i click the appwidget, the service might not have been updated because the timer has not triggered but MyDataSet is a singleton so am i not supposed to have some values there whether old or not. what am i missing in this case?..</p>