title: Always getting data null from notification intent android
body: <p>Always getting bundle null....</p>
  
  <p>This is my code;</p>
  
  <pre><code>  edt=(EditText)findViewById(R.id.edt);
  
      String msg=edt.getText().toString();
  
      //create Intent
       Intent myIntent = new Intent(this, ScondActivity.class);
      myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  
      //Here I pass Data;
      myIntent.putExtra("msg",msg);
  
      //Initialize PendingIntent
      pendingIntent = PendingIntent.getActivity(this, 0, myIntent, PendingIntent.FLAG_UPDATE_CURRENT);
      //Initialize NotificationManager using Context.NOTIFICATION_SERVICE
      notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  
      //Create listener to listen button click
      OnClickListener listener = new OnClickListener() {
          public void onClick(View view) {
              //Prepare Notification Builder
              notificationBuilder = new NotificationCompat.Builder(MainActivity.this)
                      .setContentTitle("Notification Demo").setSmallIcon(R.mipmap.ic_launcher).setContentIntent(pendingIntent)
                      .setContentText(edt.getText().toString());
              //add sound
              Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
              notificationBuilder.setSound(uri);
              //vibrate
              long[] v = {500,1000};
              notificationBuilder.setVibrate(v);
              notificationBuilder .setContentIntent(pendingIntent);
              notificationManager.notify(1, notificationBuilder.build());
          }
      };
      Button btn = (Button)findViewById(R.id.button);
      btn.setOnClickListener(listener);
  </code></pre>
  
  <p>ScondActivity.java</p>
  
  <pre><code>public class ScondActivity extends Activity {
  TextView textView;
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.msglayout);
  
  }
  
  @Override
  public void onNewIntent(Intent intent){
  
      Bundle extras = getIntent().getExtras();
      textView = (TextView)findViewById(R.id.msg);
  
      if(extras != null) {
          String tabNumber = extras.getString("msg");
          textView.setText(tabNumber);
          Log.d("TEMP", "Tab Number: " + tabNumber);
  
      } else {
          Log.d("TEMP", "Extras are NULL");
      }
  }
   }
  </code></pre>