FirstscreenActivity.
java
package [Link];
import
import
import
import
import
import
[Link];
[Link];
[Link];
[Link];
[Link];
[Link];
public class FirstscreenActivity extends Activity {
Button bt1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link]);
bt1=(Button)findViewById([Link].button1);
[Link](new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent it=new
Intent(getApplicationContext(),[Link]);
startActivity(it);
}
});
}
}
[Link]
package [Link];
import [Link];
import [Link];
import [Link];
public class Secondscreenactivity extends Activity {
Button button1;
public void onCreate(Bundle bundle) {
[Link](bundle);
setContentView([Link]);
}
}
[Link]
<RelativeLayout xmlns:android="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".FirstscreenActivity" >
<TextView
android:id="@+id/textview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Im First Activity Screen"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textview1"
android:text="Click on this for second screen" />
</RelativeLayout>
[Link]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@id/textview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginLeft="30dp"
android:text="Im Second Activity Screen"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
[Link]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[Link]
package="[Link]"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="[Link]"
android:label="@string/app_name" >
<intent-filter>
<action android:name="[Link]" />
<category android:name="[Link]" />
</intent-filter>
</activity>
<activity android:name=".Secondscreenactivity" >
</activity>
</application>
</manifest>