user16611899
user16611899

Reputation:

where to find r.java in android studio in latest version

I'm reading a book in that book they say I can find R.java file in some sort of path but I go thought the path they said I can't find the file and I think in latest version of android studio looks like they changed it , so now where I can find the r.java file

Upvotes: 1

Views: 528

Answers (1)

gtxtreme
gtxtreme

Reputation: 3586

The R file is a generated class. The easiest way to find it is opening any activity you like say the MainActivity which comes in by default

You will have something like this in the onCreate function

public void onCreate(Bundle bundle){
   setContentView(R.layout.activity_main):

}

In this method you can find the R class. To know what's actually inside it you can hover your mouse pointer over the R and then Ctrl + Click( Win, Linux) or Cmd + Click (mac) it to get to the definition

Upvotes: 1

Related Questions