1

This is basically all the code you need to see from my app. My question is, how do I set the background of the MediaRouteButton using AttributeSet? It is crucial I do it in this manner for reasons.

attrs = new AttributeSet(); // <-- something like this mrButton = new MediaRouteButton(context, attrs); // <-- Used like this

Basic reason why, I'm getting an error where the MediaRouteButton background is not allowed to be translucent. Setting to background to e.g. transparent or white or something should do the trick.

Also, if possible, how can the width/height of the button be set in the same manner?

Simon Hyll
  • 3,265
  • 3
  • 24
  • 44
  • 1
    Check this link you will get your answer http://stackoverflow.com/questions/29028168/how-to-pass-attributeset-when-creating-programmtically-in-android. Simply implement object of attrs as per as your requirement – Rajesh N Apr 26 '17 at 03:53

0 Answers0