title: i cannot receive any notification from my server
body: <p>this is my class that receive data from server: it does not show notification 
  <strong>but if i take sendBroadcast(intent) and Intent out of try and catch blocks and make msg=null; it show notification  but with empty message</strong>
  please i need your help.</p>
  
  <pre><code>package com.example.hussienalrubaye.myapplication;
  
  
  import android.app.IntentService;
  import android.content.Intent;
  import android.support.annotation.Nullable;
  import android.util.Log;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.io.BufferedInputStream;
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  
  
  public class Sev_data extends IntentService {
      public static boolean ServiceIsRun = false;
      public Sev_data() {
          super("MyWebRequestService");
      }
      @Override
      protected void onHandleIntent(@Nullable Intent intent) {
          while (ServiceIsRun) {
              int id_s=0;//هنا رقم اخر رسلة وصلة التطبيق
              String url0 = "http://localhost/sendapp.php?co&gt;"+id_s;//رايط ملف الداتة من السيرفر
              String  msg;
              try {
                  URL url = new URL(url0);
                  HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
                  InputStream in = new BufferedInputStream(urlConnection.getInputStream());
                  msg = Stream2String(in);
                  in.close();
                  JSONObject jsonRootObject = new JSONObject(msg);
                  JSONArray jsonArray = jsonRootObject.optJSONArray("date");
                  for (int i = 0; i &lt; jsonArray.length(); i++) {
                      JSONObject jsonObject = jsonArray.getJSONObject(i);
                      String id= jsonObject.optString("id");
                      String title = jsonObject.optString("title");
                      String mess = jsonObject.optString("description");
                      ///// هنا نهاية الموضوع دي اخر رسلة علي السيرفر
                  }
                  // creat new intent
                  intent = new Intent();
                  //set the action that will receive our broadcast
                  intent.setAction("com.example.Broadcast");
                  // add data to the bundle
                  intent.putExtra("msg", msg);
                  // send the data to broadcast
                  sendBroadcast(intent);
                  //delay for 50000ms
              } catch (Exception e) {
              }
              try{
                  Thread.sleep(20000);
              }catch (Exception ex){}
          }
      }
      String date="";
      public String Stream2String(InputStream inputStream) {
          BufferedReader bureader=new BufferedReader( new InputStreamReader(inputStream));
          String line ;
          String Text="";
          try{
              while((line=bureader.readLine())!=null) {
                  Text+=line;
              }
              inputStream.close();
          }catch (Exception ex){}
          return Text;
      }
  }
  </code></pre>
  
  <p>and this is receiver class:</p>
  
  <pre><code>package com.example.doblist.mydobservice;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  
  public class MyReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          // get the bundles in the message
          final Bundle bundle = intent.getExtras();
          // check the action equal to the action we fire in broadcast,
          if   (   intent.getAction().equalsIgnoreCase("com.example.Broadcast"))
          //read the data from the intent
          { NewMessageNotification notfilyme= new NewMessageNotification();
              notfilyme.notify(context,bundle.getString("msg"),223);}
          //  Toast.makeText(context,bundle.getString("msg"),Toast.LENGTH_LONG).show();
      }
  }
  </code></pre>
  
  <p>i add all AndroidManifest permission all things well but it dose not show notification
  <strong>I want to know. is the cod that get data from server true or not</strong></p>