title: Weird bug when using BroadcastReceiver for connection changes
body: <p>I implemented Volley library in one of my apps! I have a data load button and when i click it, it checks for a timestamp and then accordingly downloads the data, if there are new or notifies the user that he already has the latest data available. </p>
  
  <p>Though i wanted to also implement a receiver for Connectivity changes in order to download the data or update them, when the app starts. Everything goes fine till the time it reaches the StringRequest for the timestamp value. </p>
  
  <p>At this point something really weird happens. Although the Request responses back with the correct timestamp, the code first executes the get method for the timestamp and then the set method which makes the timestamp variable be null. This happens only when the data check is triggered by the BroadcastReceiver.</p>
  
  <p>When it's manually triggered everything goes fine....</p>
  
  <p><strong>CheckTimestamp Method</strong></p>
  
  <pre><code>private void checkTimestamp(){
      mTimestampRequest = new StringRequest(DatabaseSharer.TIMESTAMP_URL,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      Log.d(Menu.class.getSimpleName(), "Responsed back -- " + response);
                      setmTimeStamp(response);
                  }
              },new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                  }
              }
      );
      mRequestQueue.add(mTimestampRequest);
  }
  </code></pre>
  
  <p><strong>Order of method calls</strong></p>
  
  <pre><code>        checkTimestamp();
          Log.d(Menu.class.getSimpleName(),"dataStaff-1st else entered");
          String lastTimestamp = shared.getString("time", "none");
          final String temp = getmTimeStamp();
          Log.d(Menu.class.getSimpleName(), "temp= " + temp + " -- lasttimestamp = " + lastTimestamp);
  </code></pre>
  
  <p>Receiver Logcat (see that the get is null and executed before the set)
  <img src="https://i.stack.imgur.com/vx4uo.png" alt="enter image description here"></p>
  
  <p>Logcat when it triggers manually (get is also executed before but has the correct response)
  <img src="https://i.stack.imgur.com/pbiaM.png" alt="enter image description here"></p>
  
  <p>I am out of ideas so if anyone can help me i would be thankful!!</p>