コード例 #1
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (savedInstanceState == null) {
      x = 50;
    } else {
      x = savedInstanceState.getInt("x");
    }
    y = 50;
    vw = new MyView(this);
    vw.setFocusable(true);
    vw.setFocusableInTouchMode(true);
    setContentView(vw);
  }
コード例 #2
0
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putInt("x", x);
 }