java - cannot resolve symbol R, setContentView() android studio -


i have found numerous posts issue , read through them. have tried rebuilding project, project clean , gradle-clean still didn't help.

perhaps there's wrong codes?

the error lies in "setcontentview(r.layout.read_comments)" cannot resolve symbol r

here code:

package com.example.mysqltest;  import android.app.activity; import android.os.bundle;  public class readcomments extends activity{      @override     protected void oncreate(bundle savedinstancestate) {         // todo auto-generated method stub         super.oncreate(savedinstancestate);         setcontentview(r.layout.read_comments);     } } 

this error happened if there error in 1 of xml layout files. in case, project failed generate r file. check other errors appears know error , in xml layout file caused this. if project working before , not working now, check project history know modification caused error.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -