Beruflich Dokumente
Kultur Dokumente
android.os.Bundle;
android.app.Activity;
android.content.Intent;
android.view.Menu;
android.view.View;
android.view.View.OnClickListener;
android.widget.Button;
android.app.Activity;
android.os.Bundle;
android.view.View;
android.view.View.OnClickListener;
android.widget.TextView;
<string name=app_name>Navigation</string>
<string name=hello_world>Hello world!</string>
<string name=menu_settings>Settings</string>
<string name=title_activity_main>MainActivity</string>
<string name=button_name>Go to second screen</string>
<string name=title1>Welcome to Agn\s Navigation (First screen)</string>
<string name=title2>Welcome to Agn\s Navigation (second screen)</string>
</resources>
Step 6: In the Android.Manifest.xml file we need to add our second activity,
paste the below code in Android.Manifest.xml,
<manifest xmlns:android=http://schemas.android.com/apk/res/android”
package=com.agn.navigation
android:versionCode=1
android:versionName=1.0 >
<uses-sdk
android:minSdkVersion=8
android:targetSdkVersion=15 />
<application
android:icon=@drawable/ic_launcher
android:label=@string/app_name
android:theme=@style/AppTheme >
<activity
android:name=.MainActivity
android:label=@string/title_activity_main >
<intent-filter>
<action android:name=android.intent.action.MAIN />
<category android:name=android.intent.category.LAUNCHER />
</intent-filter>
</activity>
<activity android:name=Second_screen></activity>
</application>
</manifest>
Note:
1. Bold letters indicates necessary part for navigation. so that you can take on
ly this part and use in your project.
2. List of files we created and its use,
MainActivity.java (for first screen customization)
secondActivity.java (by button navigation we go to second screen from first scre
en)
activity_main.xml (textview, edittext, button configurations of mainactivity(fir
st screen))
second_screen.xml (all the configurations of second activity)