• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Problem with R.java

tgpoletti

Newbie
I am very new to Android and programming in general. I am learning through a book right now, build an application step by step.

When I was creating an .xml file, I accidently created a typo in the first line of code:
Code:
<?xml= version"1.0" encoding="utf-8"?>

My mistake was that I forgot the first equals sign in the code. As a result my R.java file deleted itself.

I fixed my typo, clean and rebuilt my project, and voila: R.java came back.

Except that on my main activity .java file, all of the lines of code that import (I don't know the correct term) "files/objects?" from R.java turned into errors.

The only way that I have been able to remove these errors is by deleting the line of code, import android.R; . My application still runs after this, but its making me nervous.

I know that not importing my generating java files cannot work out in the long run and removing the file was not the correct way to go about fixing the problem.

Can anyone make sense out of this for me?
 
You're not supposed to use "import android.R;", so removing this is correct. Eclipse or android sdk has a bad tendency to import android.R to try to fix problems for you.
 
Back
Top Bottom