public final <E extends View> E find(int id) {
try {
return (E) findViewById(id);
} catch (ClassCastException ex) {
Log.e("MainActivity", "Could not cast View to concrete class.", ex);
throw ex;
}
}
try {
return (E) findViewById(id);
} catch (ClassCastException ex) {
Log.e("MainActivity", "Could not cast View to concrete class.", ex);
throw ex;
}
}