Working through the Android TabLayout tutorial I ran into a problem.
I think the tutorial is incomplete.
When I add
spec = tabHost.newTabSpec("artists").setIndicator("Artists",
开发者_JAVA技巧 res.getDrawable(R.drawable.ic_tab_artists))
in the onCreate
method, I get
c_tab_artists cannot be resolved or is not a field.
I've created the corresponding XML file in the drawable directory but the problem persists.
Does anyone know the reason for this error?
ic_tab_artists
is the icon you're supposed to copy to the drawable
directory. In the tutorial, see step 3.
精彩评论