Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package com.example.newapp;
  2.  
  3. import android.os.Bundle;
  4. import android.app.Activity;
  5. import android.widget.*;
  6. import android.view.View.*;
  7. import android.view.*;
  8.  
  9. public class MainActivity extends Activity{
  10.     private Button b;
  11.     public void onCreate(Bundle saveInstanceState){
  12.         super.onCreate(saveInstanceState);
  13.               //activity1.xml
  14.         setContentView(R.layout.activity1);
  15.         b=(Button)findViewById(R.id.newButton1);
  16.         b.setOnClickListener(new OnClickListener(){
  17.             public void onClick(View view){
  18.                            //activity2.xml
  19.                 setContentView(R.layout.activity2);
  20.             }
  21.         });
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement