开发者

make 2 package in the same project

how to make 2 package in the same project and each package has R.java thx to help 开发者_开发知识库me


If you are using eclipse IDE for android and creates new package, It will generate the R.java file automatically in that package in gen folder. But if you are not using eclipse then you can create R.java file as you have created previously for that package.


by Google Android developper

You should never edit this file by hand

Android Developper

R class In Eclipse, open the file named R.java (in the gen/ [Generated Java Files] folder). It should look something like this: package com.example.helloandroid; A project's R.java file is an index into all the resources defined in the file. You use this class in your source code as a sort of short-hand way to refer to resources you've included in your project. This is particularly powerful with the code-completion features of IDEs like Eclipse because it lets you quickly and interactively locate the specific reference you're looking for. It's possible yours looks slighly different than this (perhaps the hexadecimal values are different). For now, notice the inner class named "layout", and its member field "main". The Eclipse plugin noticed the XML layout file named main.xml and generated a class for it here. As you add other resources to your project (such as strings in the res/values/string.xml file or drawables inside the res/drawable/ direcory) you'll see R.java change to keep up. When not using Eclipse, this class file will be generated for you at build time (with the Ant tool). You should never edit this file by hand.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜