title: Code work when wifi off and 3G on but not when wifioff and 4G
body: <p>what i have done is</p>
  
  <p>i am playing stream in wifi and 3g is also on.
  I disabled the wifi, stream stops but restart immidately cause 3g is enable.</p>
  
  <p>But problem starts when wifi and 4g is on, that time its not working</p>
  
  <p>i added listener like </p>
  
  <pre><code>IntentFilter intentFilter = new IntentFilter();
  intentFilter.addAction(android.net.ConnectivityManager.CONNECTIVITY_ACTION);
  registerReceiver(receiver,intentFilter) ;   
  </code></pre>
  
  <p>And receiver is</p>
  
  <pre><code>BroadcastReceiver receiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
  
  
  
              try{  {
                  if(GetNetworkStatus.isNetworkAvailable(getApplicationContext()))
                     {if(!mIsPlaying)
                      justPlay();
  
                     }
                  else
                  {justStop();
  
                   handler=new Handler();
  
                      r = new Runnable()
                      {
                          public void run() 
                          {
  
                              try{
                                  Thread.sleep(4000);
                                  }
                                  catch(Exception s)
                                  {}
                              if(GetNetworkStatus.isNetworkAvailable(getApplicationContext()))
                              justPlay();
                              /*if(!mIsPlaying)
                              handler.postDelayed(this, 3000);*/
                          }
                      };
                      try{
                           handler.postDelayed(r, 1000);
  
                       }
                       catch(Exception e)
                       {
  
                       }
  
                  Toast.makeText(getApplicationContext(), "Internet Connection Failed", Toast.LENGTH_LONG).show();
                  }
              }
              }
              catch(Exception e)
              {
                  finish();
              } }
          };
  </code></pre>