SimpleCursorAdapter within a ScrollView

I'm having abit of an issue and i'm not too sure how to go about solving it.

Essentially i have an activity which has a base xml layout of ScrollView and i want this activity to list some results from a Cursor. So i thought i'd use SimpleCursorAdapter... however when i got it all set up it appears that the ListView that the SimpleCursorAdapter goes into doesn't play nice being within another scrollable layout element.

I've sorta got it working programmically but i'd much rather use a ListAdapter as it will make each list entry look like a button and keep it inline with the design of the rest of the application and can handle the ids of each item and where to send the user upon clicking.

So my question is this: is there anyway to either make ListView show all the items such that it never needs to scroll, or can i change the ListView to something like a LinearLayout?

I hope that makes sense! Any help / insight / ideas are welcome! Cheers!

Answers


You can NEVER use a scroll view and a ListView together. Its a mess! and illogical as well.

Here are some of the approaches you can use:

  1. Theres no screen big enough to show all the content of you listView you can try wrapping up your content but as I said it won't help as scroll view and list view don't work together. So you can either remove your or
  2. If your list items are simple you can dynamically add your views to LinearLayout with specified location

Another tip I can give you is you can always use an relative layout and place your listView alignParentBottom="true" and emit the scrollView approach this will make you listview alwyas scrollable.


Need Your Help

Java Mail Listening For Messages POP3

java smtp javamail pop3

I am trying to listen for new messages using the POP3 protocol. I am aware that Pop3 doesn't allow new messages to appear in the Inbox while the folder is open. Below is the code that I have implem...

How do I determine if an email is Base64 encoded?

python email encoding jython email-headers

I am having difficulty determining if the body of a text email message is base64 encoded.