Calling close() on a Cursor that's backing a ListView

by Mark Murphy » Sat, 10 Apr 2010 01:27:07 GMT

Sponsored Links

This is intentional. The Cursor is tied to the UI thread once you put it
in a CursorAdapter and attach that CursorAdapter to an AdapterView
(e.g., ListView).

Mark Murphy (a Commons Guy)  | 

Android Training in NYC: 4-6 June 2010: 


Other Threads

1. Micro SD di Nexus setelah rooting nggak kebaca di Noteboo

Maksudnya setelah colok usb lalu di mount tapi tidak terbaca?

Coba di card reader ?


2. button background hangs, or disappears

I have a button that shows exactly as it should, until I have clicked
it, then it doesn's show it's background any more. The funny thing is
that all other buttons of the same style loose their backgrounds as
well. Sometimes the opposite happens: all backgrounds in my app get
the button background.

The style that defines the button is

        <style name="image_button">
                <item name="android:layout_width">wrap_content</item>
                <item name="android:layout_height">wrap_content</item>
                <item name="android:textColor">@color/button_text</item>
                <item name="android:textSize">16sp</item>
                <item name="android:paddingLeft">10dip</item>
                <item name="android:paddingRight">10dip</item>
                <item name="android:paddingTop">3dip</item>
                <item name="android:paddingBottom">3dip</item>
                <item name="android:gravity">center_vertical</item>
                <item name="android:background">@drawable/mybutton</item>

The statelist "mybutton" is

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="">
    <item android:state_enabled="false"
          android:drawable="@drawable/btn_disabled" />
    <item android:state_enabled="true"
          android:drawable="@drawable/btn_pressed" />
    <item android:state_enabled="true"
          android:drawable="@drawable/btn_selected" />
    <item android:state_enabled="true"
          android:drawable="@drawable/btn_button" />

I have tried extending the Button class and set the backgroundDrawable
from there, to no avail. How can my button make other similar buttons
in different activities disappear? How can my button background show
up in activities that don't have any buttons?

Help is appreciated :-)


3. ClassCastException using <View> element

4. Widgets: Can the widget icon be different...

5. Overlay in Bounded Lat Long Possible?

6. How to make a Widget start an app?

7. Users marking down free apps because missing paid app features