public RemoteViews getViewAt(int position)
{
Log.i("APP", "getViewAt");
if (position < 0 || position >= getCount()) { return null; }
getAllApps(mContext);
PackageInfo res = apps.get(position);
views = new RemoteViews(mContext.getPackageName(), R.layout.layout_item);
views.setTextViewText(R.id.name, mPackageManager.getApplicationLabel(res.applicationInfo));
views.setImageViewBitmap(R.id.icon, drawableToBitmap(mPackageManager.getApplicationIcon(res.applicationInfo)));
mPackageManager = mContext.getPackageManager();
Intent intent1 = new Intent(Intent.ACTION_MAIN, null);
intent1.addCategory(Intent.CATEGORY_LAUNCHER);
String pkg = res.packageName;
Bundle extras = new Bundle();
// extras.putInt("page",1);
extras.putInt(MyWidgetService.EXTRA_ITEM, position);
extras.putString("pkg", pkg);
Intent fillInIntent = new Intent();
fillInIntent.putExtras(extras);
views.setOnClickFillInIntent(R.id.item, fillInIntent);
return views;
}