title: how to show TextView changes to notification in android?
body: <p>I have a TextView in my app and want to show its value in Notification. as you see below Textview shows times of media playing. when pauseBTN clicked, notification shows the times contentiously. </p>
  
  <p>but notification just show one number that minimize button clicked. how can I change it? </p>
  
  <p>my Activity class code:</p>
  
  <pre><code>public class CountActivity extends AppCompatActivity  implements View.OnClickListener{
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_count);
  
      loop_num_txt= Step2Fragment.times;
      loop_num=Integer.parseInt(loop_num_txt);
  
      mediaPlayer=new MediaPlayer();
      try {
          mediaPlayer.setDataSource(audioPath);
          mediaPlayer.prepare();
      } catch (IOException e) {
          e.printStackTrace();
          Toast.makeText(this,"فایل صوتی ضبط شده در دسترس نیست.",Toast.LENGTH_LONG).show();
      }
  
      pause= (Button) findViewById(R.id.pauseBTN); pause.setOnClickListener(this);
      play= (Button) findViewById(R.id.playBTN); play.setOnClickListener(this);
      stop= (Button) findViewById(R.id.stopBTN); stop.setOnClickListener(this);
      minimize= (Button) findViewById(R.id.minimizeBTN); minimize.setOnClickListener(this);
  
      start(loop_num);
  }//oncreate
  
  public void start(final int i){
      show_time = i;
      mediaPlayer.start();
  
      int duration = mediaPlayer.getDuration();
      animationDrawable.addFrame(getResources().getDrawable(R.drawable.t1),duration);
  
      counter.setText(Integer.toString(show_time));
  
  
      mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
          @Override
          public void onCompletion(MediaPlayer mediaPlayer) {
              show_time--;
              if (show_time !=0){
                  start(show_time);
              }else {
                  vibrate(1000);
                  counter.setText("0");
                  imageView.setBackgroundResource(R.drawable.t2);
              }
          }
      });
  
  }
  
  
  @Override
  public void onClick(View view) {
      resume_txt = counter.getText().toString();
      int resume_int=Integer.parseInt(resume_txt);
  
      switch (view.getId()){
          case R.id.pauseBTN:
              mediaPlayer.pause();
              animationDrawable.stop();
              play.setVisibility(View.VISIBLE); pause.setVisibility(View.GONE);
              break;
  
          case R.id.playBTN:
              start(resume_int);
              play.setVisibility(View.GONE); pause.setVisibility(View.VISIBLE);
              break;
  
          case R.id.stopBTN:
              animationDrawable.stop();
              mediaPlayer.stop();
              counter.setText("0");
              finish();
              startActivity(new Intent(CountActivity.this,MainActivity.class));
              break;
  
          case R.id.minimizeBTN:
              Intent intent= new Intent(CountActivity.this,NotifyService.class);
              //intent.putExtra("times",resume_txt);
              startService(intent);
              moveTaskToBack(true);
              break;
  
      }
  
  
  }
  </code></pre>
  
  <p>and my service code:</p>
  
  <pre><code> public class NotifyService extends Service {
      public NotificationCompat.Builder builder;
  
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          Intent notificationIntent_Restore = new Intent(this,CountActivity.class);
          PendingIntent restoreIntent = PendingIntent.getActivity(this,
                  0, notificationIntent_Restore, PendingIntent.FLAG_UPDATE_CURRENT);
  
           builder= (NotificationCompat.Builder) new NotificationCompat.Builder(this)
                  .setSmallIcon(R.mipmap.ic_launcher)
                  .setAutoCancel(false)
                   .setContentText(CountActivity.resume_txt)
                  .setContentIntent(restoreIntent);
  
          NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
          manager.notify(0, builder.build());
          return super.onStartCommand(intent, flags, startId);
      }
  
      @Nullable
      @Override
      public IBinder onBind(Intent intent) {
          return null;
      }
  
  
  
  }
  </code></pre>