I need a circle object as follows :

The name and count extracts info from a DB and displays it for each circle.
The circle needs to be clickable so I’m thinking of extending the Button class.
What do I do in the onDraw and onMeasure methods to create this? Also once created, how do I use this class? How can I call this component to be displayed in my screen with other component views?
EDIT: I have read many posts and some tutorials and none have been too helpful for “customized views”
You don’t need extend the button class to do this.
If I were you I probably wouldn’t even make a custom View, I would use a LinearLayout with 2 TextViews in it. And the background on the linear layout I would set to a png of the circle.
something like this would be the xml;
Make sure to put circle.png into your
drawablefolder.You can gain references to all of these Views with
findViewById();So once you have references to the TextViews you can set the text to whatever you need. And with the LinearLayout reference you can set a click listener on it the exact same way as you would for a Button.something like this would work:
You could even make this layout as its own xml file and use an Adapter to be able to fill some other structure with these circles like a GridView perhaps. You’d just need to inflate the Views and populate the text inside your Adapters getView() method.