21

I am making a widget for one of my applications which includes a ListView.

I want to display a list of 2 records on my widget. I have searched many forums and tutorials but could not find any tutorial on ListViews in widgets.

Can any one provide me with some good code/tutorials from where i can learn to implement ListViews in Android Widgets.

1

2 Answers 2

22

CommonsGuy has a sample widget application in GitHub using a ListView in a homescreen widget: LoremWidget

Sign up to request clarification or add additional context in comments.

4 Comments

That example seems not to run on my Droid Bionic
i am using LoremWidget right now. how can i get a refernce to the listview there? getListView() does nothing :/
that sample now has properly specified its min sdk as 11 (3.x) github.com/commonsguy/cw-advandroid/commit/…
I tried to use this, but I got problems. I tried to discribe them: stackoverflow.com/questions/31713373/…
-1

Bit late in the day but I've just done this using 3 horizontal linearlayouts within a vertical ll. Set each of the horizontal lls to visibility GONE and then just set visibility to VISIBLE and set text for each one you want to show

Doesn't use a listview but achieves the same end.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.