Added fail safes

pull/178/head
M66B 5 years ago
parent 58ad6b0465
commit d89c6fe433

@ -699,6 +699,7 @@ public class FragmentCompose extends FragmentBase {
@Override @Override
public boolean setViewValue(View view, Cursor cursor, int columnIndex) { public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
try {
int id = view.getId(); int id = view.getId();
if (id == R.id.tvName) { if (id == R.id.tvName) {
if (colName < 0) if (colName < 0)
@ -733,6 +734,9 @@ public class FragmentCompose extends FragmentBase {
} }
return true; return true;
} }
} catch (Throwable ex) {
Log.e(ex);
}
return false; return false;
} }
}); });
@ -742,6 +746,7 @@ public class FragmentCompose extends FragmentBase {
private int colEmail = -1; private int colEmail = -1;
public CharSequence convertToString(Cursor cursor) { public CharSequence convertToString(Cursor cursor) {
try {
if (colName < 0) if (colName < 0)
colName = cursor.getColumnIndex("name"); colName = cursor.getColumnIndex("name");
if (colEmail < 0) if (colEmail < 0)
@ -757,14 +762,19 @@ public class FragmentCompose extends FragmentBase {
sb.append("<").append(email).append(">"); sb.append("<").append(email).append(">");
} }
return sb.toString(); return sb.toString();
} catch (Throwable ex) {
Log.e(ex);
return ex.toString();
}
} }
}); });
cadapter.setFilterQueryProvider(new FilterQueryProvider() { cadapter.setFilterQueryProvider(new FilterQueryProvider() {
public Cursor runQuery(CharSequence typed) { public Cursor runQuery(CharSequence typed) {
Log.i("Suggest contact=" + typed);
MatrixCursor result = new MatrixCursor(new String[]{"_id", "name", "email", "photo", "local"}); MatrixCursor result = new MatrixCursor(new String[]{"_id", "name", "email", "photo", "local"});
try {
Log.i("Suggest contact=" + typed);
if (typed == null) if (typed == null)
return result; return result;
@ -867,7 +877,11 @@ public class FragmentCompose extends FragmentBase {
.add(item.avatar) .add(item.avatar)
.add(item.id == 0 ? 0 : 1); .add(item.id == 0 ? 0 : 1);
} }
} catch (Throwable ex) {
Log.e(ex);
}
Log.i("Suggesting contacts=" + result.getCount());
return result; return result;
} }
}); });

Loading…
Cancel
Save