android - Crash in ListView at AbsListView.obtainView for ListActivity -


i'm watching content updates on listactivity using contentobserver follows:

protected void oncreate(bundle savedstate)    {         super.oncreate(savedstate);          contentresolver cr = getcontentresolver();          cursor cursor = cr.query(trackheader.content_uri, stracklistprojection, null, null, null);         startmanagingcursor(cursor);          this.madapter = new trackheaderdataadapter(this, r.layout.track_list_item, cursor, stracklistprojection, null);         setlistadapter(madapter);          handler handler = new handler();          mtrackheaderobserver = new contentobserver(handler) {               @override               public boolean deliverselfnotifications() {                   return false;              }               @override              public void onchange(boolean selfchange) {                  super.onchange(selfchange);                  contentresolver cr = getcontentresolver();                  madapter.changecursor(cr.query(trackheader.content_uri, stracklistprojection, null, null, null));               }          };        getcontentresolver().registercontentobserver (trackheader.content_uri, true, mtrackheaderobserver);   } 

this content observer seems ok -- gets called on ui thread getting following random crash pretty predictably on underlying listview:

02-21 14:06:00.440: error/androidruntime(739): java.lang.nullpointerexception 02-21 14:06:00.440: error/androidruntime(739):     @  android.widget.abslistview.obtainview(abslistview.java:1276) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.listview.makeandaddview(listview.java:1668) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.listview.filldown(listview.java:637) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.listview.fillspecific(listview.java:1224) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.listview.layoutchildren(listview.java:1499) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.abslistview.onlayout(abslistview.java:1113) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.framelayout.onlayout(framelayout.java:333) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.framelayout.onlayout(framelayout.java:333) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.framelayout.onlayout(framelayout.java:333) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.linearlayout.setchildframe(linearlayout.java:1119) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.linearlayout.layoutvertical(linearlayout.java:998) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.linearlayout.onlayout(linearlayout.java:918) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.framelayout.onlayout(framelayout.java:333) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.framelayout.onlayout(framelayout.java:333) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.widget.framelayout.onlayout(framelayout.java:333) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.view.layout(view.java:6830) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.viewroot.performtraversals(viewroot.java:996) 02-21 14:06:00.440: error/androidruntime(739):     @ android.view.viewroot.handlemessage(viewroot.java:1633) 02-21 14:06:00.440: error/androidruntime(739):     @ android.os.handler.dispatchmessage(handler.java:99) 02-21 14:06:00.440: error/androidruntime(739):     @ android.os.looper.loop(looper.java:123) 02-21 14:06:00.440: error/androidruntime(739):     @ android.app.activitythread.main(activitythread.java:4363) 02-21 14:06:00.440: error/androidruntime(739):     @ java.lang.reflect.method.invokenative(native method) 02-21 14:06:00.440: error/androidruntime(739):     @ java.lang.reflect.method.invoke(method.java:521) 02-21 14:06:00.440: error/androidruntime(739):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:860) 02-21 14:06:00.440: error/androidruntime(739):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:618) 02-21 14:06:00.440: error/androidruntime(739):     @ dalvik.system.nativestart.main(native method) 02-21 14:09:56.159: error/androidruntime(749): error: thread attach failed 02-21 14:09:59.480: error/androidruntime(760): error: thread attach failed 02-21 14:12:19.449: error/androidruntime(778): error: thread attach failed 02-21 14:12:22.779: error/androidruntime(789): error: thread attach failed 02-21 14:12:26.479: error/gralloc(51): [unregister] handle 0x3f13b8 still locked (state=40000001) 

anyone seen before -- been stumped on 1 few days...

tim

i had similar stack trace , discovered returning null getview() method in cases.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -