title: Save Changed Text Of a TextView
body: <p>I have an Button in my first activity which changes it background onclick and save with SharedPreferences , but I want to set one more code that when I check the button it set the text of a TextView in my second activity to "Button-Checked" and when I uncheck it set the text of the TextView to "Button-Unchecked" and then SAVE the text (with SharedPreferences or anything else).
  In my first activity:</p>
  
  <pre><code>public class MainActivity extends Activity {
  private boolean likechek;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      final Button like = (Button) findViewById(R.id.like);
      like.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View arg0) {
              SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(Dog.this);
              sp.edit().putBoolean("like_", !likechek).commit();
              LikeAnalayzer();
          }
      });
  
  }
  
      private void LikeAnalayzer() {
      SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
      likechek = sp.getBoolean("like_", false);
      UpdateLikeButton();
  }
  
      private void UpdateLikeButton() {
      Button like = (Button) findViewById(R.id.like);
  
      if(likechek){
          like.setBackgroundResource(R.drawable.starf);
      }else{
          like.setBackgroundResource(R.drawable.star);
  
      }
  
  }           
  }
  </code></pre>
  
  <p>and Second (its empty):</p>
  
  <pre><code>public class Fav extends Activity {
  TextView tv ;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.fav);
      tv = (TextView) findViewById(R.id.tv);
      tv.setText("");
      }
  }
  </code></pre>
  
  <p>Thanks for your answer , I really need it.</p>