Khurram Majeed
Khurram Majeed

Reputation: 2411

Layout file and r.java

Is it possible to convert R.java into layout file xxx.xml.. In some project which I got from internet the layout file is missing and all I have now is R.java.

So is there any way that I can create/extract information from R.java file to make the layout xml file.

Upvotes: 0

Views: 256

Answers (3)

Ibid Athoillah
Ibid Athoillah

Reputation: 95

you can't do that, if R.java deleted your only way is add the xml again. i think create layout programmatically in android better than with xml. because the R doesn't need to generate. but the weakness of programmatical layout is you must declare id by your self. generate or manual which one do you like :)

Upvotes: 0

user658042
user658042

Reputation:

That is not possible. the R class only handles references to content (like layouts), not the content itself.

Upvotes: 2

MikeWallaceDev
MikeWallaceDev

Reputation: 1468

R.Java is the pretty much the only file that you don't need. This file is automatically generated when your project is compiled.

Because of this, you should not edit this file in any way.

Therefore, if all you have is the R.java file... Well, you have nothing.

Upvotes: 0

Related Questions