Jump to content

How to Create a Custom Composite Widget in Android

0
  BrilliantBot's Photo
Posted May 26 2011 01:26 PM

I just put up another Android development blog post. Here's the except:

This example puts a couple of TextViews into a LinearLayout. The combination of components is then treated as one component with the added functionality of programmatically changing the text of the two TextViews. I pretty much modified this off of something I learned and forgot. It took me a good bit of digging to find it again. Check maohao.com for the original source/alternate version. I’m putting it here so I don’t loose it (again). I’m sure it’s somewhere on developer.google.com but I just couldn’t find a specific example not bogged down by other code (i.e., ListView). Also, I’m not even sure this works well for ListView. That said, it does have practical applications. For example, a list that will always be small.

http://www.anotheran...droid-component

Cheers
Randall

0 Replies