I have a ragged hierarchy of parents and children. In that there are some parents that have 5 children...and some parents have 0 children.
The expandableListView displays the "Expand/Collpase" icon even if there are no children.
Question-Is there a way to hide the icon for only those Parents(rows) that have no children? I still want to show the row of the Parents with no children. And allow a user to click on them. But the "Expand/Collapse" icon is confusing.
I have a WebView in my Android App that is loading an HTML string using the loadDataWithBaseURL() method. The problem is that local anchor links (<a href="#link">...) are not working correctly. When the link is clicked, it becomes highlighted, but does not scroll to the corresponding anchor.
This also does not work if I use the WebView's loadUrl() method to load a page that contains anchor links. However, if I load the same URL in the browser, the anchor links do work.
Is there any special handling required to get these to work for a WebView?
I am using API v4 (1.6).
There isn't much to the code, here are the relevant parts of some test code I've been working with:
Is there a way to expand the VM limit in Android 2.0 on an actual device? Using java.lang.Runtime.maxMem() on a Droid reveals a limit of 24MB, and I've written some code that incrementally allocates memory until failure to verify that figure. You can set the VM size in the emulator, but I haven't yet found a way to do that for a connected phone. Is there some type of a properties file on the device itself that can be modified?
I need to resize several images inside ImageView to screen size. Currently I use scaleType="centerInside", it works good for bigger images to scale them down to screen size but doesn't expand small images.
All other suggested options crop or deform image. Is there any way to expand images (keeping ratio) via XML or do I have to do it manually in code?
Is there any settings/flags to expand the summary text of a notification to two lines instead of 1? The text I am trying to put is too long and it goes over the visible area? Will try something like (text+"/n"+restOfText) tomorrow but I don't think it's going to work...
Basically I am trying to recreate the default contact screen when you click on "+" button another row of Phone number added to the list. Right now I have an ImageView as the "+" button and a ListView to contain the list of phone numbers. The problem is that the ListView doesn't expand when I add more item into the list. I could build the same look with LinearLayout but how can I save all those numbers that way? Below is the layout of the item that will be inflate with custom Adapter:
I have an ImageView, and I want it to be clickable. The image itself is only 32x32 pixels, but I want the clickable region to be larger so it's easier to hit. I was hoping I could set the layout margin values to increase the size of the imageview's clickable area:
That doesn't work, what I could do is just recreate the image resource to have a larger transparent region around it. That's a bit annoying because it's hard to tweak if I ever need to change the clickable region. It's not just a single png either, it's a statelistdrawable so I have to resize 3 different pngs if I ever need to tweak the clickable area.
In my app I have nice ExpandableListView. I would like sometime, depending of situation, to expand some or all groups. I would also like to be able to remove/hide groups, expand all and basically have (visually) ExpandableListView without groups. I looked at all available methods for ExpandableListView and couldn't find any that would do what I want to do.
I'm having a little problem with a ListView scrollbar. The scrollbar appears at the side as expected, but how do I get the scrollbar to expand and become controllable in the same way it behaves in the Contact list? Ideally I'd like all the Contacts list functionality for my app - i.e. to allow me to control the scrollbar directly with a finger and to show the first letter of the list elements you're currently scrolled to.
I have an expandable list view with a static array for the group data and an SQLite database for the child data. It is implemented with the BaseExpandableListAdapter and works great, except, when I edit the database to delete or add children to the list I do not see the changes onscreen. It looks like I can use the registerDataSetObserver method to notify the adapter and expandable list of a data change. What I have to do in the callback to make Android redraw the list after data changes is what I need to know. Can I do it? Documentation on this part of the SDK is a bit sparse and expandable list view example code is not a good match. Can anyone offer advice on how to use a DataSetObserver? It feels like I have to switch over to a Cursor type adapter.
I have an ExpandableListView with several groups and each group contains several children. I want to make this list searchable, just like a regular list view. I have a SimpleCursorTreeAdapter (mAdapter) for this expandlable list.
I tried to use the built in list filter using:
The above code does not work for filtering.
How can I implement the search/filter functionality?
I am rendering a ListView inside a dialog. The ListView elements are very simple TextView objects. The problem: whatever I do, they never take the full width in the list view, which has the side effect that the list view selector only covers the actual text, not the whole list entry (i.o.w., if the text of the entry is much smaller than the width of the listview/dialog, then only a tiny portion of the list element is highlighted when focusing it).
I have a list view which uses a custom adapter in order to show my custom content. Its layout is the following.
I would like that the listview only showed the view with the ids itemimage and item description, keeping the itemtext hidden.
The idea is to have an onclicklistener on each item of the list, in order to expand that item so it shows the itemtext content. I know I should use Tweening animation in order to expand/collapse each item, but I can't figure out how to do that.
I'm trying to add a context menu to my ExpandableListView. I've implemented onCreateContextMenu() and onContextItemSelected() but if I hold my finger on a menu item context menu doesn't appear. What's my mistake?
I have an ExpandableListView bound to a SQLite database. To simplify things, lets assume the database contains two columns: title and body. In the ExpandableListView, there is a group for each title, and a childfor each corresponding body.
Now to make things more interesting, some of the rows in the SQLite database do not have a body (that is... they only have a title). As you can see, if there is no body, then there is no reason to expand the group... because the child will be empty (i.e. String body == "").
I'm searching for a way to catch a situation like this, and skip the group's expansion. I don't want a blank child to be expanded. To put it in psuedo code, I want something like this: