9 December 2011

What to do,when suddenly all R values start display error message "cannot be solved or is not a field"?

Case:
U have some fun with line when you use some stuff from R.class (R.id etc.)
You edit your awesome class (for example activity) and suddenly   suddenly all R.id , R.layout and all R.* start display error message  "cannot be solved or is not a field".
 for example

   case R.id.diagnose_button: <-during editing line like this

and u messing around with R.id.something and ... BOOOM ... error message  "cannot be solved or is not a field" is everywhere near to R.*(something)..

Solution:

It means your IDE for some awkward reason decided to add line:
import android.R;

which cause a problem. simply remove above import and everything will back to nomral.

Simple.

No comments:

Post a Comment