Sony
Sony

Reputation: 7196

Not able to refer to any project resources without fully qualified name

I am not able to refer to any of my project resources without the fully qualified package name

like com.mypackagename.abc.R.layout.menu_item_layout instead if using R.layout.menu_item_layout my project's target sdk is api level 19 and minimum required sdk is api level 10 and `compatible with api level 17'. Why iam not able to refer the resources in the normal way.can anyone find any fix for this

Upvotes: 0

Views: 76

Answers (3)

Darish
Darish

Reputation: 11481

  1. Remove all R imports from that Class.
  2. save the files
  3. Now import the correct R file

Upvotes: 1

Ilya Gazman
Ilya Gazman

Reputation: 32226

You have imports problem. Try manually adding:

import com.mypackagename.abc.R;

And make sure that R is not already imported. Because you are not allowed to import more than one file with same name. The solution is to use full package name in code as you are now.

Upvotes: 1

Pozzo Apps
Pozzo Apps

Reputation: 1857

Check your imports... probably you have wrongly imported "android.R".

Upvotes: 1

Related Questions