示例#1
0
 @Override
 protected void onResume() {
   SharedPreferences settings = getSharedPreferences(PREF_TITLE, 0);
   if (settings.getBoolean(PREF_BACKGROUND, DEFAULT_BACKGROUND) == true) {
     TextView tv_background = (TextView) findViewById(R.id.status_textView_background);
     tv_background.setText("RUN IN BACKGROUND");
   }
   super.onResume();
 }
  public void onResume() {
    super.onResume();
    // These two statements just reregister the two buttons with their listeners
    sendMessageButton.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intent = new Intent(getApplicationContext(), SelectMessageActivity.class);
            startActivity(intent);
          }
        });

    viewMessageButton.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intent = new Intent(getApplicationContext(), ViewMessageActivity.class);
            startActivity(intent);
          }
        });
  }