use of ru.playsoftware.j2meloader.applist.AppsListAdapter in project J2ME-Loader by nikita36078.
the class MainActivity method setupActivity.
private void setupActivity() {
initFolders();
checkActionBar();
appsListFragment = new AppsListFragment();
ArrayList<AppItem> apps = new ArrayList<>();
AppsListAdapter adapter = new AppsListAdapter(this, apps);
appsListFragment.setListAdapter(adapter);
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.container, appsListFragment).commitAllowingStateLoss();
initDb();
updateAppsList();
}
use of ru.playsoftware.j2meloader.applist.AppsListAdapter in project J2ME-Loader by nikita36078.
the class MainActivity method updateAppsList.
private void updateAppsList() {
String appSort = sp.getString("pref_app_sort", "name");
List<AppItem> apps;
if (appSort.equals("name")) {
apps = appItemDao.getAllByName();
} else {
apps = appItemDao.getAllByDate();
}
AppsListAdapter adapter = (AppsListAdapter) appsListFragment.getListAdapter();
adapter.setItems(apps);
adapter.notifyDataSetChanged();
}
Aggregations