I need to create a custom, reusable view component. I’ve been trying to look around to see how exactly custom views in android are created. But I’m a little confused.
I need an example or an explanation of the steps I need to take in order to make this happen.
What I need in my view is the following: two TextView and two Button, which already have their functionality programmed. The button should increment or decrease an int which is displayed on the Quantity TextView.
|----------------------------------------------------------------|
| |
| Name of Item --- Quantity --- (Button Minus) --- (Button Plus) |
| |
|----------------------------------------------------------------|
Therefore, I would get this component by calling something like MyComp mc = new MyComp() and would get the values as normal (mc.getName, mc.getQty)
Please view the android documentation regarding CompoundControls.