예제 #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);
 }