Research on the problem of Android activity jump transfer value

Source: Internet
Author: User

Java code
    1. Intent = New Intent ();
    2. Intent.setclass (loginactivity. This, regactivity.  class);
Java code
    1. 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
  1. <?xml version="1.0" encoding="Utf-8"?>
  2. <manifest xmlns:android="Http://schemas.android.com/apk/res/android"
  3. package= "com.vt.demo.login" android:versioncode="1"
  4. Android:versionname="1.0" >
  5. <application android:icon="@drawable/icon" android:label="@string/app_name" >
  6. <activity android:name=". Loginactivity "android:label=" @string/app_name ">
  7. <intent-filter>
  8. <action android:name="Android.intent.action.MAIN"/>
  9. <category android:name="Android.intent.category.LAUNCHER"/>
  10. </intent-filter>
  11. </activity>
  12. <activity android:name=". Regactivity "android:label=" @string/app_name ">
  13. <intent-filter>
  14. <action android:name="Android.intent.action.MAIN"/>
  15. <category android:name="Android.intent.category.LAUNCHER"/>
  16. </intent-filter>
  17. </activity>
  18. </application>
  19. <USES-SDK android:minsdkversion="8"/>
  20. </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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.