Skip to content

Deprecated method #1

Description

@jlvivero

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));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions