You are again loading data in the Ui thread in AsynchTask
so change your AsynchTask
like this..
public class addItems extends AsyncTask<Object, String, Drawable> {
private TextView title;
private ImageView icon;
private int pos;
@Override
protected Drawable doInBackground(final Object... parameters) {
title = (TextView) parameters[0];
icon = (ImageView) parameters[1];
pos = (Integer) parameters[2];
entry = (ApplicationInfo) mListAppInfo.get(pos);
Drawable drawable = entry.loadIcon(mPackManager);
return drawable;
}
@Override
protected void onPostExecute(Drawable result) {
super.onPostExecute(result);
icon.setImageDrawable(result);
title.setText(entry.loadLabel(mPackManager));
}
}
here i am loading drawable in another thread and passing it to onPostexecute
so no overhead on UI thread..setting text is not a difficult task in doInbackGround
method.