I’m completely new to java, I need to import both:
import com.myapp.R;
import android.R
at the same time sine I need to use translations from my strings.xml folder and also the the icon R.drawable.ic_media_play. However I get an error due to imports collisions.
How can I access resources both from android and my app?
You can’t import both. The convention is to import your project’s R file (com.myapp.R), and to use full package notation when using the android R file. This way, it’s easy to tell when your referencing your own identifiers, and when you’re referencing an external identifier.
So if you wanted to reference the
ic_media_playidentifer, you’d useandroid.R.drawable.ic_media_play.