Guest User

Untitled

a guest
Apr 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. public class Foo extends Activity {
  2.     public void onCreate(Bundle savedInstanceState) {
  3.         super.onCreate(savedInstanceState);
  4.  
  5.         Button button = new Button(this);
  6.         button.setOnClickListener(new OnClickListener() {
  7.             public void onClick(View view) {
  8.                 startActivity(new Intent(Foo.this, Bar.class));
  9.                 finish();
  10.             }
  11.         });
  12.  
  13.         setContentView(button);
  14.     }
  15.  
  16.     protected void onDestroy() {
  17.         super.onDestroy();
  18.  
  19.         Log.e("you're it", "isFinishing() == " + isFinishing());
  20.     }
  21. }
  22.  
  23. // ---
  24.  
  25. public class Bar extends Activity {
  26.     public void onCreate(Bundle savedInstanceState) {
  27.         super.onCreate(savedInstanceState);
  28.  
  29.         TextView textView = new TextView(this);
  30.         textView.setText("hello, world");
  31.  
  32.         setContentView(textView);
  33.     }
  34. }
Add Comment
Please, Sign In to add comment