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

by westmeadboy » Sat, 10 Apr 2010 00:55:29 GMT


Sponsored Links
 I'm using a SimpleCursorAdapter with ListView.

I just noticed that calling AbstractCursor.close() in a non-UI thread
will cause this exception:

android.view.ViewRoot$CalledFromWrongThreadException: Only the
original thread that created a view hierarchy can touch its views.
    at android.view.ViewRoot.checkThread(ViewRoot.java:2462)
    at android.view.ViewRoot.requestLayout(ViewRoot.java:512)
    at android.view.View.requestLayout(View.java:7071)
    at android.view.View.requestLayout(View.java:7071)
    at android.view.View.requestLayout(View.java:7071)
    at android.view.View.requestLayout(View.java:7071)
    at android.view.View.requestLayout(View.java:7071)
    at android.widget.AbsListView.requestLayout(AbsListView.java:969)
    at android.widget.AdapterView
$AdapterDataSetObserver.onInvalidated(AdapterView.java:811)
    at
android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java:
43)
    at
android.widget.BaseAdapter.notifyDataSetInvalidated(BaseAdapter.java:
54)
    at android.widget.CursorAdapter
$MyDataSetObserver.onInvalidated(CursorAdapter.java:391)
    at
android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java:
43)
    at
android.database.AbstractCursor.deactivateInternal(AbstractCursor.java:
89)
    at android.database.AbstractCursor.close(AbstractCursor.java:108)

Is this a bug or intentional?

--



Other Threads

1. Paging adityo

Maaf numpang jalum
Bro tyo di hub nyaut

Hehehehe 
Gtalk ye

Thanks mods
Ch 
sent by jave aka jupe

-- 
"Indonesian Android Community [id-android]" 

2. OOT:alternatif IPad

moga2 tidak repost,
http://mashable.com/2010/01/27/9-upcoming-tablet-alternatives-to-the-apple-ipad/,
ada yang mau siap2 nabung mulai sekarang?
*tidur lagi ahhh*

-- 
"Indonesian Android Community [id-android]" 

3. permission denied on devce

4. SMSan di Android?

5. aPad/iRobot 2nd generatio

6. ask : download manager yang bagus

7. Help : Gmail amplop merah gak bisa save attachment