Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialkris Moore
1,752 Pointsdepreciated methods.
Android Studio says: ".getDrawable(page.getImageId())" and .getDrawable() also has a strike through it, will this affect the code?
1 Answer
Seth Kroger
56,413 Points"Deprecated" doesn't mean "removed (yet)" so it can still be used. If you want to future-proof your code you change it to:
ContextCompat.getDrawable(getActivity(), R.drawable.name)
Zachary Blasczyk
723 PointsZachary Blasczyk
723 PointsWhat is meant by
R.drawable.name
Do you mean that we should type
Please help.
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsIt's the resource id for the Drawable image, which is usually in the form of
R.drawable.etc
but can be an int variable or result from a method. In the Interactive Story app it should be the image id of the page, i.e., page.getImageId().