Skip to content

Commit 16b41d0

Browse files
JAVATECHIGJAVATECHIG
authored andcommitted
added Starting an activity for a result
1 parent 0dcb8c2 commit 16b41d0

File tree

17 files changed

+275
-0
lines changed

17 files changed

+275
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.activitytest"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="14"
9+
android:targetSdkVersion="17" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@drawable/ic_launcher"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme" >
16+
<activity
17+
android:name="com.example.activitytest.FirstActivity"
18+
android:label="@string/app_name" >
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
26+
<activity
27+
android:name="com.example.activitytest.SecondActivity"
28+
android:label="@string/app_name" >
29+
</activity>
30+
31+
</application>
32+
33+
</manifest>
102 KB
Loading
7.48 KB
Loading
3.69 KB
Loading
12.2 KB
Loading
24.2 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="fill_parent"
5+
android:background="@drawable/bg"
6+
android:orientation="vertical"
7+
android:padding="10dp"
8+
tools:context=".FirstActivity" >
9+
10+
<TextView
11+
android:id="@+id/textView1"
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:layout_centerHorizontal="true"
15+
android:layout_marginTop="10dp"
16+
android:text="Activity 1"
17+
android:textAppearance="?android:attr/textAppearanceLarge" />
18+
19+
<Button
20+
android:id="@+id/start_button"
21+
android:layout_width="fill_parent"
22+
android:layout_height="wrap_content"
23+
android:layout_alignParentBottom="true"
24+
android:layout_centerHorizontal="true"
25+
android:background="@android:color/holo_blue_dark"
26+
android:text="Start Activity 2" />
27+
28+
</RelativeLayout>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="fill_parent"
5+
android:background="@drawable/bg"
6+
android:orientation="vertical"
7+
android:padding="10dp"
8+
tools:context=".FirstActivity" >
9+
10+
<TextView
11+
android:id="@+id/textView1"
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:layout_centerHorizontal="true"
15+
android:layout_marginTop="10dp"
16+
android:text="Activity 2"
17+
android:textAppearance="?android:attr/textAppearanceLarge" />
18+
19+
<LinearLayout
20+
android:layout_width="fill_parent"
21+
android:layout_height="wrap_content"
22+
android:layout_alignParentBottom="true"
23+
android:layout_marginTop="50dp"
24+
android:orientation="horizontal"
25+
android:weightSum="2" >
26+
27+
<Button
28+
android:id="@+id/cancel_button"
29+
android:layout_width="0dp"
30+
android:layout_height="wrap_content"
31+
android:layout_gravity="center"
32+
android:layout_margin="2dp"
33+
android:layout_weight="1"
34+
android:background="@android:color/holo_blue_dark"
35+
android:text="Cancel" />
36+
37+
<Button
38+
android:id="@+id/return_button"
39+
android:layout_width="0dp"
40+
android:layout_height="wrap_content"
41+
android:layout_gravity="center"
42+
android:layout_margin="2dp"
43+
android:layout_weight="1"
44+
android:background="@android:color/holo_blue_dark"
45+
android:text="Return Results" />
46+
</LinearLayout>
47+
48+
</RelativeLayout>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!--
4+
Customize dimensions originally defined in res/values/dimens.xml (such as
5+
screen margins) for sw600dp devices (e.g. 7" tablets) here.
6+
-->
7+
8+
</resources>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<resources>
2+
3+
<!--
4+
Customize dimensions originally defined in res/values/dimens.xml (such as
5+
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
6+
-->
7+
<dimen name="activity_horizontal_margin">128dp</dimen>
8+
9+
</resources>

0 commit comments

Comments
 (0)