SueSmith/android-drawing-app

Deprecated method

Opened this issue · 0 comments

In lines:

  • 50
  • 103
  • 104
    of:
    MainActivity.java

the method getResources().getDrawable() is deprecated

I'm currently using this as the base for a school project (so thank you for sharing this in the first place and for the tutorial as well, it helped me understand how android handled touch interaction coordinates without having to do all the research from scratch)

Reading a little bit about the topic it was suggested to use:
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
{
imgView.setImageDrawable(getResources().getDrawable(R.drawable.paint_pressed));
currPaint.setImageDrawable(getResources().getDrawable(R.drawable.paint));
}