1) Create a Android Project
Fill in the project information
2) Create a new Activity
Right click on the left side of Eclipse (default) you want to join the activity package, for example, my package is com. Indroid.layout. Then select New->class, enter the class name (note the first letter capitalized), and click on Superclass's Browse. Finally, enter activity in choose a type. And then you can just click OK.
3) create Activity layouts
Create a layout XML page in the Rec/layout folder new->others->android->android XML file
4) Register the created activity to androidmanifest.xml
Use Eclisps to visualize the Add, double-click androidmanifest.xml Select Label Application->add->activity, enter the class name you just created.
Can also be added manually, under the </activity> tag
<activity android:name= ". New Activity 's name "
android:label= " New Activity the title ">
</activity>
It is important to note that the android:name= "." Here's a point, which means the activity is under the com.INdroid.layout of the package I've chosen.
5) Add the OnCreate method to the new activity and bind layout.
On the activity jump problem, to add that the button binding Setonclicklistener must be placed after the new Onclicklistener object, or not jump.
In this, an activity that can be used is created, and the next step is to add UI elements and implement the page response code
The following is an example of adding a checkbox, the effect is to click on the main activity interface, jump to the Checkboxactivity interface
1. Add a button to the main activity interface. Open main: XML, using the "+" of the outline window, add a button to fill in the button's properties
2, in the Src/activitymain class, that is, the main activity of the interface response class to implement the page jump code,
2.1 Declaring the button variable and listener Onclicklistener
2.2 Implement the Onclicklistener listener's jump logic, that is, the ONCLIHCK function
2-3 binding listener Onclicklistener to button
3. Add a checkbox widget to the Checkboxactivity interface
4. Add rendering code to the Checkboxactivity interface