0

I currently have a DrawingView which looks like this:

 <com.example.drawingapp.DrawingView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/drawing_view" android:background="#80ffffff" /> 

Within my code, I am setting the background to nothing earlier on using:

drawing_view.setBackgroundResource(0) 

What I want to be able to do is be able to revert the background back to '#80ffffff' through my code. I have the following which is wrong:

drawing_view.setBackgroundResource(ContextCompat.getColor(context, Color.parseColor("#80ffffff"))) 

Thanks!

1 Answer 1

1

You can use:

drawing_view.setBackgroundColor(Color.parseColor("#80ffffff")) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.