コード例 #1
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   MenuInflater inflater = getMenuInflater();
   inflater.inflate(menuId, menu);
   return true;
 }
コード例 #2
0
  // Implement save/restore
  protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);

    String st = savedInstanceState.getString("debugViewText");
    if (st == null) return;
    TextView tv = getTextView();
    tv.setText(st);
    Log.d(tag, "Restored state");
  }
コード例 #3
0
  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (this.m_retainState == false) return;

    // save state
    TextView tv = getTextView();
    String t = tv.getText().toString();
    outState.putString("debugViewText", t);
    Log.d(tag, "Saved state");
  }
コード例 #4
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.debug_activity_layout);
 }