Guest User

Untitled

a guest
Aug 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. package com.androidtest;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.View;
  7. import android.view.View.OnClickListener;
  8. import android.widget.Button;
  9.  
  10. public class AndroidTest21Activity extends Activity {
  11.     /** Called when the activity is first created. */
  12.     @Override
  13.     public void onCreate(Bundle savedInstanceState) {
  14.         super.onCreate(savedInstanceState);
  15.         setContentView(R.layout.main);
  16.  
  17.         Button sB = (Button) findViewById(R.id.button1);
  18.         sB.setOnClickListener(new OnClickListener()
  19.         {
  20.             public void onClick(View v)
  21.             {
  22.                 Intent startNewActivityOpen = new Intent(AndroidTest21Activity.this, SubActiv.class);
  23.                 startActivity(startNewActivityOpen);
  24.             }
  25.         });
  26.     }
  27. }
Add Comment
Please, Sign In to add comment