title: Notification not Opening my app
body: <p>I have (strange!) another question for all of you!</p>
  
  <p>I have this code :</p>
  
  <pre><code>package com.radio.radiostar;
  
  import android.app.Activity;
  import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.media.MediaPlayer;
  import android.media.MediaPlayer.OnBufferingUpdateListener;
  import android.media.MediaPlayer.OnPreparedListener;
  import android.os.Bundle;
  import android.support.v4.app.NotificationCompat;
  import android.util.Log;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.ProgressBar;
  
  import java.io.IOException;
  
  
  
   public class MainActivity extends Activity implements OnClickListener {
  
  private final static String RADIO_STATION_URL = "http://178.32.137.180:8665/stream";
  
  private ProgressBar playSeekBar;
  
  private Button buttonPlay;
  
  private Button buttonStopPlay;
  
  private MediaPlayer player;
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      initializeUIElements();
  
      initializeMediaPlayer();
  }
  
  
  private void initializeUIElements() {
  
      playSeekBar = (ProgressBar) findViewById(R.id.progressBar1);
      playSeekBar.setMax(100);
      playSeekBar.setVisibility(View.INVISIBLE);
  
      buttonPlay = (Button) findViewById(R.id.buttonPlay);
      buttonPlay.setOnClickListener(this);
  
      buttonStopPlay = (Button) findViewById(R.id.buttonStopPlay);
      buttonStopPlay.setEnabled(false);
      buttonStopPlay.setOnClickListener(this);
  
  }
  
  @SuppressWarnings("unused")
  public void onClick(View v) {
      if (v == buttonPlay) {
          startPlaying();
          Context context = getApplicationContext();
          CharSequence text = "In Connessione...";
          int duration = android.widget.Toast.LENGTH_LONG;
          android.widget.Toast toast = android.widget.Toast.makeText(context, text, duration);
          toast.show();
          Object nm;
          nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
  
          Intent intent = new Intent(this,MainActivity.class);
          PendingIntent pendingIntent = null;
          NotificationCompat.Builder mBuilder =
  
                  new NotificationCompat.Builder(this)
                  .setSmallIcon(R.drawable.ic_launcher)
                  .setContentTitle("Radio Star")
                  .setContentText("In Diretta")
                  .setContentIntent(pendingIntent); //Required on Gingerbread and below
          PendingIntent pIntent = PendingIntent.getActivity(this, 0, new Intent(), Intent.FLAG_ACTIVITY_NEW_TASK);
          NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
          notificationManager.notify( 0, mBuilder.build());
      } else if (v == buttonStopPlay) {
          stopPlaying();
          Intent svc=new Intent(this, BackgroundSoundService.class);
          startService(svc);
      }
  }
  
  private void startPlaying() {
      if (player.isPlaying()) {
          buttonPlay.setVisibility(View.INVISIBLE);
      }
      buttonStopPlay.setEnabled(true);
      buttonPlay.setEnabled(false);
      buttonPlay.setVisibility(View.INVISIBLE);
      playSeekBar.setVisibility(View.VISIBLE);
  
  
      player.prepareAsync();
  
      player.setOnPreparedListener(new OnPreparedListener() {
  
          public void onPrepared(MediaPlayer mp) {
              player.start();
          }
  
      });
  
  }
  
  private void stopPlaying() {
      if (player.isPlaying()) {
          player.stop();
          player.release();
          initializeMediaPlayer();
          NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(NOTIFICATION_SERVICE);
          notificationManager.cancel(0);
      }
  
      buttonPlay.setEnabled(true);
      buttonStopPlay.setEnabled(false);
      playSeekBar.setVisibility(View.INVISIBLE);
      buttonPlay.setVisibility(View.VISIBLE);
  
  }
  
  private void initializeMediaPlayer() {
      player = new MediaPlayer();
      try {
          player.setDataSource(RADIO_STATION_URL);
      } catch (IllegalArgumentException e) {
          e.printStackTrace();
      } catch (IllegalStateException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      player.setOnBufferingUpdateListener(new OnBufferingUpdateListener() {
  
          public void onBufferingUpdate(MediaPlayer mp, int percent) {
              playSeekBar.setSecondaryProgress(percent);
              Log.i("Buffering", "" + percent);
          }
      });
  }
  
  @Override
  public void onBackPressed()
  {
     moveTaskToBack(false);
  
  
  }
  
  
  };
  </code></pre>
  
  <p>On the notification part, i have the problem that this notification don't open the app.
  Any suggestion?
  I was trying a lot of possibility, but nothing... where i'm wrong? Help me please.</p>