SHARE
TWEET

Untitled

a guest Jun 16th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. OnClickListener onClickListener = new OnClickListener() {
  2.     @Override
  3.     public void onClick(View v) {
  4.         startActivity(new Intent(action));
  5.     }
  6. };
  7.  
  8. Button button = (Button) findViewById(id);
  9. button.setOnClickListener(onClickListener);
  10.      
  11. startActivity(new Intent(this, ActivityToLaunch.class));
  12.      
  13. Button x.setOnClickListener(new View.OnClickListener() {
  14.                 public void onClick(View v)
  15.                 {
  16.                     Intent i = new Intent(y.this, Activity.class);
  17.                     startActivity(i);                  
  18.                 }
  19.         });
  20.      
  21. Button btn = (Button)findViewById(R.id.button1);
  22.  
  23. btn.setOnClickListener(new View.OnClickListener() {
  24.  
  25.     @Override
  26.     public void onClick(View v) {      
  27.  
  28.         startActivity(new Intent(TestActivity.this,second.class));
  29.  
  30.     }
  31. });
  32.      
  33. public void onClick(View v)
  34. {
  35.     Intent myintent = new Intent(currentclass.this, nextactivity.class);
  36.     startActivity(myintent);                              
  37. }
  38.      
  39. final Context cont = this;
  40. Button btnClickABC =(Button)findViewById(R.id.btnClickABC);
  41. btnClickABC.setOnClickListener(new View.OnClickListener() {
  42.  
  43.             @Override
  44.             public void onClick(View v) {                  
  45.                 startActivity(new Intent(cont, NextActivity.class));
  46.  
  47.             }
  48.         });
  49.      
  50. Intent(PresentActivity.this, NextActivity.class)
  51.      
  52. public class PresentActivity extends Activity {
  53.         protected void onCreate(Bundle icicle) {
  54.             super.onCreate(icicle);
  55.  
  56.             setContentView(R.layout.content_layout_id);
  57.  
  58.             final Button button = (Button) findViewById(R.id.button_id);
  59.             button.setOnClickListener(new View.OnClickListener() {
  60.                 public void onClick(View v) {
  61.                     // Perform action on click  
  62.  
  63.                     Intent activityChangeIntent = new Intent(PresentActivity.this, NextActivity.class);
  64.  
  65.                     // currentContext.startActivity(activityChangeIntent);
  66.  
  67.                     PresentActivity.this.startActivity(activityChangeIntent);
  68.                 }
  69.             });
  70.         }
  71.     }
  72.      
  73. Button button = (Button)findViewById(R.id.xxx);
  74.     button .setOnClickListener(new OnClickListener() {
  75.         @Override
  76.         public void onClick(View v) {
  77.         Intent intent=new Intent(CurrentActivity.this,NextActivity.class);
  78.         startActivity(intent);
  79.         }
  80.     });
  81.      
  82. startActivity(new Intent(this,newActivity.class));
  83.      
  84. <activity
  85.   android:name=".Tester"
  86.   android:label="@string/title_activity_tester" >`enter code here`
  87. </activity>
  88.  
  89.  
  90. final Button button = (Button) findViewById(R.id.btnGo);// btnGo is id
  91. button.setOnClickListener(new View.OnClickListener() {
  92.     public void onClick(View v) {
  93.         Intent i = new Intent(CurrentClass.this, Tester.class);
  94.         startActivity(i);
  95.     }
  96.      
  97. startActivity(Intent(this, LoginActivity::class.java))
  98.      
  99. startActivity(new Intent(this, LoginActivity.class))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top