mirror of https://github.com/tasks/tasks
Introduce an ErrorCatchingListView to fix a pre-ICS ListView bug (see http://stackoverflow.com/questions/12473625/nullpointerexception-at-android-widget-abslistview-contentfitsabslistview-java)
parent
b2ecdf4c65
commit
0ab32b9d58
@ -0,0 +1,31 @@
|
||||
package com.todoroo.astrid.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.ListView;
|
||||
|
||||
public class ErrorCatchingListView extends ListView {
|
||||
|
||||
public ErrorCatchingListView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ErrorCatchingListView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public ErrorCatchingListView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
try {
|
||||
return super.onTouchEvent(ev);
|
||||
} catch (Exception e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue