It seems the online tutorials have not been rewritten to reflect
Android 2.1. For they still refer to 'drawable' and 'res/drawable',
but when I create a new project for 2.1 using the wizard, I do not GET
any such directory. Instead, I get 'res/drawable-hdpi', 'res/drawable-
ldpi' and 'res/drawable-mdpi'.

Now for some tutorials, I have been able to get by by putting files in
'res/drawable-hdpi'. But for the TabLayout tutorial,
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html,
this does not work. I still get the error message (on completion of
step 3) "R.drawable.ic_tab_artists cannot be resolved".

The files "ic_tab_artists_grey.png" and "ic_tab_artists_whit.png"
really are in res/drawable-hdpi.

I also tried changing the name 'drawable' to 'drawable-hdpi', but Java
did not like the '-' in the name (no surprise).

So how are we supposed to get this to work? Go back to 1.5? Surely
there is a better way.

Just for clarity's sake, the line of code I get the error on is: spec
= tabHost.newTabSpec("artists").setIndicator("Artists",
//                          res.getDrawable
(R.drawable.ic_tab_artists))
                      .setContent(intent);

in HelloTabWidget.java.

I get the same class of error message on the other three
res.getDrawable calls, too.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to