Sunday, January 19, 2014

Android in a project to build multiple Activity Activity In addition to the construction of the first outside the other is how to build the Activity


            

Android in a project to build multiple Activity Activity In addition to the construction of the first outside the other is how to build the ActivityActivity was built first time and automatically generate a R.java main.xml if there AndroidManife.xml in this project to create a project together in an Activity by what steps, AndroidManife.xml is how to add this new Activity of. And that in the layout R.java class how to add value in this Activity? ? ? ? There's the new Activity. Xml file is not to manually create your own? ? ?
Thank you prawn! ! ! ! ! !
Grateful! ! !
Reply:
First.
new - "class ---" fill in the name --- "fill in the superclass is android.app.Activity

After completion

Double-click AndroidManife.xml
Join
node where the applicationandroid: name = "youractivityname"
/>

Reply:
After this I tried but I also added a new int value theNewActivity.xml but how to generate the corresponding layout in R.java, ah
Like this

public static final class layout {
public static final int main = 0x7f030000;
}

How to add into ah

Thanks
Reply:
Khan!
theNewActivity.xml This is not a new ah!
Just like
AndroidManife.xml
public static final class layout {
public static final int main = 0x7f030000;
}

This is a new layout file will be automatically generated. . . Did you try to generate the project right build project
Reply:
[Size = 24px] I am a beginner, I do not quite understand here, and some say that every build an online Activity (in the same project) corresponds to a. Xml file like the first one corresponds to a main.xml Activity Like, I tried to find you a new class that inherits Activity R.java this file after the value of the new class that does not appear ah like public static final int main = 0x7f030000; so I mainly want to ask how the R. How java claiming this value, fortunately setContentView (R.layout.NewActivityName)

Thank prawn
Reply:
references, 4th Floor paopaohehe reply:
[size = 24px] I am a beginner, I do not quite understand here, some say every Internet to build a Activity (in the same project) corresponds to a. xml file like the first one corresponds to a main.xml Activity, I tried to find you a new class that inherits Activity after R.java this file does not appear the new the value of the class ah like public static final int main = 0x7f030000; so I mainly want to ask how R.java ......

New layout in the layout file an xml file, such as test.xml it, set up their own layout in your new activity in its statement: setContentview (R.layout.test), so that it corresponds to the activity of this test.xml
Reply:
references, 4th Floor paopaohehe reply:
[size = 24px] I am a beginner, I do not quite understand here, some say every Internet to build a Activity (in the same project) corresponds to a. xml file like the first one corresponds to a main.xml Activity, I tried to find you a new class that inherits Activity after R.java this file does not appear the new the value of the class ah like public static final int main = 0x7f030000; so I mainly want to ask how R.java ......

Complemented. . . .
There was a note in the R.java file
/ * AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* Aapt tool from the resource data it found. It
* Should not be modified by hand.
* /
Main point is that this document can not be modified manually, it is automatically generated, we do not make any changes to this file
Reply:
I know
But I want to know how the new int value
R.java add Activity on the layout of the correspondingLike public static final int main = 0x7f030000; such
In
public static final class layout {
public static final int main = 0x7f030000;
}
No words in
setContentview (R.layout.Activityname)
Here, when a statement will be given
That is why
I beg you master! ! !
Reply:
reference to the 7th floor paopaohehe reply:
I know
But I want to know how the new int value
R.java add Activity on the layout of the correspondingLike public static final int main = 0x7f030000; such
In
public static final class layout {
public static final int main = 0x7f030000;
}
No words in
setCo ......

Landlord. . . . Do not want to modify or add anything in R.java. . . .
Res file in your layout there is a folder inside the folder you put all the activity is required layout files, as long as you create a new folder layout ****. Xml file, ready layout . It will automatically generate that you want in the R.java file, LZ not to manually modify. . . .

Reply:
Open your android project, there is a folder src, gen, res, etc., and other documents, res folder there is a folder layout
Reply:
Learn about
Reply:
After the 2nd floor of the way follow, select your project and press F5 refresh, R.java is automatically generated by the system, if it is not generated, select your project in the clean, clear look at your project, usually generated .

You just started recommend downloading some video to look at, this entry faster ~ ~
Reply:
reference to the second floor paopaohehe reply:
I tried this but then I also added a new theNewActivity.xml but how to generate the corresponding in R.java int value layout, ah
Like this

public static final class layout {
public static final int main = 0x7f030000;
}

How to add into ah

Thanks
This is automatically generated and can not be modified boss. . . .
Reply:
The landlord, basically at this stage, you are not going to want to change at any time R file content.

1 Create a new Activity
2 Create a new XML file, and the main file to the same path, you can name your own name and its own layout, test it, the main rename it.
3 registered in the AndroidManifest.xml inside.
Join
node where the applicationandroid: name = "youractivityname"
/>
4. Compile and run, you can ah.

Reply:
To learn ..................
Reply:
The key is to have all my stuff is built up, but that is not automatically generate the R.java in ah
There is no I in here setContentview (R.layout.Activityname) how to use ah

Reply:
Learning under
Reply:
The landlord to find a list of documents to be registered
AndroidManifest.xml new pageHere there are many tabs chose this one
AndroidManifest.xmlandroid: label = "@ string / app_name">





Copy this piece of code
Remove




These
For example This is the new page registered good
Layout file found under the res folder opens see main.xml layout file you this is the first page
The second need to build their own
Put the mouse on the right new layout folder and select Android XML File This option
Look down the side is fill porject Here File name
your new page layout fileFor example, we call Activity02
But be sure to add in the back Activity02. Xml
That is Activity02.xml
This can be a ・ ・
I hope to help the landlord I was a beginner, there are many problems Oh

Reply:
Forgot to say




The reason for this is because only delete the first page of your home is to run the program before they can have no intent other pages can
Reply:
Take the android Guinness shining example code for a week or so to knock a beginning. . .
Reply:
Learning ......
Reply:
Thank you heroes
I know why
That. Xml file naming format requirements
Is for this reason that led to the new Activity is not registered in the R.java file
Reply:
Novices to learn the
Reply:
When I do not always second Activity way to start, and in the second XML file can not see the style layout
Reply:
I would like to be added in the registration Activity android: label, double quotes inside the value of what is required after the equals sign, there will be an error when I casually added. Where that value is to pass over it
Reply:
A group of two goods. . So many people have no one can understand someone asked the question in the end is what. Really anxious for these people's IQ.
Reply:
People are R.java can not be generated automatically, which is their new layout file can not be automatically identified. This result is clearly a problem with the layout file.
Later, after his repeated attempts to find Android applications naming the original layout files and java or c identifier naming rules are not consistent. Summarized as follows:

Layout file name only by lowercase letters a 1 -. 4 underscores 9 3-point numbers, and can only begin with a lowercase letter. - Z digits 0 2 .. '.' I hope this to be helpful when learning android application development.
Reply:
Your sister, looked a long time, when it comes to the point on the 26th floor of the
Reply:
I also encountered a new problem, and looked for a long time and finally found 26 floor gives the correct answer, removed the name of the uppercase letters, and she R. java automatically updated
Thanks to 26 F
Reply:
26th floor right
Reply:
The old post turned out to keep fit
Reply:
26th Floor, positive solution, it really solve the problem!
Reply:
, with a new, learn

1 comment: