Java code
- Intent = New Intent ();
- Intent.setclass (loginactivity. This, regactivity. class);
Java code
- StartActivity (Intent);
Because just learned Android. So in a lot of times. I don't know where to start!
But, I once remember my teacher said such a sentence!
Regardless of the programming language. Can make a simple landing to do good! is already basic introduction!
So I tested to do an Android landing!
But in the running! I want to get a button for the "Register" button!
Then, similar to the previous make page! Jump to another page!
And in the Android is through activity jump!
Over here.
I am simply talking about some of my personal understanding and problems encountered in doing this case and share it with everyone!
For jumping words must use intent remember Oh! Also to startactivity (intent); Start the activity.
I've posted the code!
But in the setclass to pay attention to the class you want to jump! The former is generally this class! and the latter is where you are going to jump the class!
Is it just so simple?
No!
Java code
- <?xml version="1.0" encoding="Utf-8"?>
- <manifest xmlns:android="Http://schemas.android.com/apk/res/android"
- package= "com.vt.demo.login" android:versioncode="1"
- Android:versionname="1.0" >
- <application android:icon="@drawable/icon" android:label="@string/app_name" >
- <activity android:name=". Loginactivity "android:label=" @string/app_name ">
- <intent-filter>
- <action android:name="Android.intent.action.MAIN"/>
- <category android:name="Android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- <activity android:name=". Regactivity "android:label=" @string/app_name ">
- <intent-filter>
- <action android:name="Android.intent.action.MAIN"/>
- <category android:name="Android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
- <USES-SDK android:minsdkversion="8"/>
- </manifest>
In the Androidmanifest.xml file, add one more activity to note is Android:name= ". Regactivity "
The name of this name is the name of your class. In fact, it is your path! Remember that there is a dot in front of you!
Finally remember to refresh the next! Because in the R.java file, the system has automatically built an index page for you! Not refreshed! There may be errors
Research on the problem of Android activity jump transfer value