use of com.crdroid.settings.preferences.PackageListAdapter.PackageItem in project android_packages_apps_crDroidSettings by crdroidandroid.
the class SlimRecentsBlacklist method onCreateDialog.
@Override
public Dialog onCreateDialog(int dialogId) {
switch(dialogId) {
case DIALOG_BLACKLIST_APPS:
{
Dialog dialog;
AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());
final ListView list = new ListView(getActivity());
list.setAdapter(mPackageAdapter);
alertDialog.setTitle(R.string.profile_choose_app);
alertDialog.setView(list);
dialog = alertDialog.create();
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Add empty application definition, the user will be able to edit it later
PackageItem info = (PackageItem) parent.getItemAtPosition(position);
addCustomApplicationPref(info.packageName, mBlacklistPackages);
dialog.cancel();
}
});
return dialog;
}
}
return super.onCreateDialog(dialogId);
}
Aggregations