Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
package ch.arnab.simplelauncher;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import java.util.ArrayList;

/**
* Created by Arnab Chakraborty
*/
public class AppListFragment extends ListFragment implements LoaderManager.LoaderCallbacks<ArrayList<AppModel>> {
AppListAdapter mAdapter;

@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

setEmptyText("No Applications");

mAdapter = new AppListAdapter(getActivity());
setListAdapter(mAdapter);

// till the data is loaded display a spinner
setListShown(false);

// create the loader to load the apps list in background
getLoaderManager().initLoader(0, null, this);
}
Expand All @@ -36,7 +28,6 @@ public Loader<ArrayList<AppModel>> onCreateLoader(int id, Bundle bundle) {
@Override
public void onLoadFinished(Loader<ArrayList<AppModel>> loader, ArrayList<AppModel> apps) {
mAdapter.setData(apps);

if (isResumed()) {
setListShown(true);
} else {
Expand Down