Slide 41
Slide 41 text
Retro/Prospective Android Application
Loader
public class MainActivity extends Activity implements LoaderCallbacks {
public Loader onCreateLoader(int id, Bundle args) {
if (id == 0) {
return new MainLoader();
} else if (id == 1) {
return new SecondLoader();
} else {
throw new IllegalArgumentException(“invalid id”);
}
}
public void onLoadFinished(Loader loader, Data data) {
showData(data);
}
public void onLoaderReset(Loader loader) {
}
}
41
1.0 1.1 Cupcake Donut Eclair Froyo Gingerbread Honeycomb Ice Cream Sandwich Jelly Bean Kitkat Lollipop Marshmallow Nougat Oreo