List of usage examples for android.view View getTag
@ViewDebug.ExportedProperty
public Object getTag()
From source file:org.ednovo.goorusearchwidget.SearchResults_resource.java
/** * @function name :createhandoutLayout/*from ww w. j av a 2 s . com*/ * * This function is used to add 5 more resources in horizontallist * view. * * @param 5 list(resUrls, resTitles, resCategory, resDescription, * resGooruOid); * * @return void * * */ // handout public void createhandoutLayout(List<String> resincUrls, List<String> resincTitle, List<String> resincCategory, List<String> resincDescription, List<String> resincGooruid) { LinearLayout scrollChild = (LinearLayout) findViewById(R.id.layoutHandout); int size = resincUrls.size(); Log.i("Size to check :", "" + size); List<String> resTempincGooruid = new ArrayList<String>(); resTempincGooruid = resincGooruid; int intial = 0; if (handoutresGooruOid.size() > 4) { intial = handoutresGooruOid.size() - 5; } else { handoutRight.setVisibility(View.GONE); } Log.i("intial", "" + intial); for (int i = 0; i < size; i++) { resourcelayout = LayoutInflater.from(this).inflate(R.layout.resource_view, null); TextView title = (TextView) resourcelayout.findViewById(R.id.textViewTitle); title.setText(nullCheck(resincTitle.get(i), "None Added")); TextView category = (TextView) resourcelayout.findViewById(R.id.textViewSource); category.setText(nullCheck(resincCategory.get(i), "None Added")); TextView descr = (TextView) resourcelayout.findViewById(R.id.textViewDescription); descr.setText(nullCheck(resincDescription.get(i), "None Added")); FetchableImageView image = (FetchableImageView) resourcelayout.findViewById(R.id.imgViewRes); image.setImage(resUrls.get(i), R.drawable.resourcedefault); resourcelayout.setTag(intial); imageViewCategory = (ImageView) resourcelayout.findViewById(R.id.imageViewCategory); imageViewCategory.setImageDrawable(getResources().getDrawable(R.drawable.handouts_ico)); intial++; scrollChild.addView(resourcelayout, new LinearLayout.LayoutParams(250, 180)); resourcelayout.setPadding(10, 0, 10, 0); resourcelayout.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { int s = (Integer) v.getTag(); Log.i("Size completeGooruOid :", "" + handoutresGooruOid.size()); // Flurry Log flag_isPlayerTransition = true; resourceType = "Handout"; resourceGooruId = handoutresGooruOid.get(s); Intent intentResPlayer = new Intent(getBaseContext(), ResourcePlayer.class); Bundle extras = new Bundle(); extras.putInt("key", s); extras.putString("token", token); extras.putString("searchkey", searchKeyword); extras.putStringArrayList("goor", handoutresGooruOid); intentResPlayer.putExtras(extras); startActivity(intentResPlayer); } }); } }
From source file:org.ednovo.goorusearchwidget.SearchResults_resource.java
/** * @function name : createlessonLayout//w ww. ja va 2 s .c om * * This function is used to add 5 more resources in horizontallist * view. * * @param 5 list(resUrls, resTitles, resCategory, resDescription, * resGooruOid); * * @return void * * */ // lesson public void createlessonLayout(List<String> resincUrls, List<String> resincTitle, List<String> resincCategory, List<String> resincDescription, List<String> resincGooruid) { LinearLayout scrollChild = (LinearLayout) findViewById(R.id.layoutLesson); int size = resincUrls.size(); Log.i("Size to check :", "" + size); List<String> resTempincGooruid = new ArrayList<String>(); resTempincGooruid = resincGooruid; int intial = 0; if (lessonresGooruOid.size() > 4) { intial = lessonresGooruOid.size() - 5; } else { lessonRight.setVisibility(View.GONE); } Log.i("intial", "" + intial); for (int i = 0; i < size; i++) { resourcelayout = LayoutInflater.from(this).inflate(R.layout.resource_view, null); TextView title = (TextView) resourcelayout.findViewById(R.id.textViewTitle); title.setText(nullCheck(resincTitle.get(i), "None Added")); TextView category = (TextView) resourcelayout.findViewById(R.id.textViewSource); category.setText(nullCheck(resincCategory.get(i), "None Added")); TextView descr = (TextView) resourcelayout.findViewById(R.id.textViewDescription); descr.setText(nullCheck(resincDescription.get(i), "None Added")); FetchableImageView image = (FetchableImageView) resourcelayout.findViewById(R.id.imgViewRes); image.setImage(resUrls.get(i), R.drawable.resourcedefault); resourcelayout.setTag(intial); imageViewCategory = (ImageView) resourcelayout.findViewById(R.id.imageViewCategory); imageViewCategory.setImageDrawable(getResources().getDrawable(R.drawable.lesson_ico)); intial++; scrollChild.addView(resourcelayout, new LinearLayout.LayoutParams(250, 180)); resourcelayout.setPadding(10, 0, 10, 0); resourcelayout.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { int s = (Integer) v.getTag(); Log.i("Size completeGooruOid :", "" + lessonresGooruOid.size()); // Flurry Log flag_isPlayerTransition = true; resourceType = "Lesson"; resourceGooruId = lessonresGooruOid.get(s); Intent intentResPlayer = new Intent(getBaseContext(), ResourcePlayer.class); Bundle extras = new Bundle(); extras.putInt("key", s); extras.putString("token", token); extras.putString("searchkey", searchKeyword); extras.putStringArrayList("goor", lessonresGooruOid); intentResPlayer.putExtras(extras); startActivity(intentResPlayer); } }); } }
From source file:org.ednovo.goorusearchwidget.SearchResults_resource.java
/** * @function name :createtextbookLayout/* ww w . j a v a 2s . c om*/ * * This function is used to add 5 more resources in horizontallist * view. * * @param 5 list(resUrls, resTitles, resCategory, resDescription, * resGooruOid); * * @return void * * */ // textbook public void createtextbookLayout(List<String> resincUrls, List<String> resincTitle, List<String> resincCategory, List<String> resincDescription, List<String> resincGooruid) { LinearLayout scrollChild = (LinearLayout) findViewById(R.id.layoutTextbook); int size = resincUrls.size(); Log.i("Size to check :", "" + size); List<String> resTempincGooruid = new ArrayList<String>(); resTempincGooruid = resincGooruid; int intial = 0; if (textbookresGooruOid.size() > 4) { intial = textbookresGooruOid.size() - 5; } else { textbookRight.setVisibility(View.GONE); } Log.i("intial", "" + intial); for (int i = 0; i < size; i++) { resourcelayout = LayoutInflater.from(this).inflate(R.layout.resource_view, null); TextView title = (TextView) resourcelayout.findViewById(R.id.textViewTitle); title.setText(nullCheck(resincTitle.get(i), "None Added")); TextView category = (TextView) resourcelayout.findViewById(R.id.textViewSource); category.setText(nullCheck(resincCategory.get(i), "None Added")); TextView descr = (TextView) resourcelayout.findViewById(R.id.textViewDescription); descr.setText(nullCheck(resincDescription.get(i), "None Added")); FetchableImageView image = (FetchableImageView) resourcelayout.findViewById(R.id.imgViewRes); image.setImage(resUrls.get(i), R.drawable.resourcedefault); resourcelayout.setTag(intial); imageViewCategory = (ImageView) resourcelayout.findViewById(R.id.imageViewCategory); imageViewCategory.setImageDrawable(getResources().getDrawable(R.drawable.textbook_ico)); intial++; scrollChild.addView(resourcelayout, new LinearLayout.LayoutParams(250, 180)); resourcelayout.setPadding(10, 0, 10, 0); resourcelayout.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { int s = (Integer) v.getTag(); Log.i("Size completeGooruOid :", "" + textbookresGooruOid.size()); // Flurry Log flag_isPlayerTransition = true; resourceType = "Textbook"; resourceGooruId = textbookresGooruOid.get(s); Intent intentResPlayer = new Intent(getBaseContext(), ResourcePlayer.class); Bundle extras = new Bundle(); extras.putInt("key", s); extras.putString("token", token); extras.putString("searchkey", searchKeyword); extras.putStringArrayList("goor", textbookresGooruOid); intentResPlayer.putExtras(extras); startActivity(intentResPlayer); } }); } }
From source file:org.ednovo.goorusearchwidget.SearchResults_resource.java
/** * @function name :createexamLayout// ww w . j ava 2 s . c o m * * This function is used to add 5 more resources in horizontallist * view. * * @param 5 list(resUrls, resTitles, resCategory, resDescription, * resGooruOid); * * @return void * * */ // exam public void createexamLayout(List<String> resincUrls, List<String> resincTitle, List<String> resincCategory, List<String> resincDescription, List<String> resincGooruid) { LinearLayout scrollChild = (LinearLayout) findViewById(R.id.layoutExam); int size = resincUrls.size(); Log.i("Size to check :", "" + size); List<String> resTempincGooruid = new ArrayList<String>(); resTempincGooruid = resincGooruid; int intial = 0; if (examresGooruOid.size() > 4) { intial = examresGooruOid.size() - 5; } else { examRight.setVisibility(View.GONE); } Log.i("intial", "" + intial); for (int i = 0; i < size; i++) { resourcelayout = LayoutInflater.from(this).inflate(R.layout.resource_view, null); TextView title = (TextView) resourcelayout.findViewById(R.id.textViewTitle); title.setText(nullCheck(resincTitle.get(i), "None Added")); TextView category = (TextView) resourcelayout.findViewById(R.id.textViewSource); category.setText(nullCheck(resincCategory.get(i), "None Added")); TextView descr = (TextView) resourcelayout.findViewById(R.id.textViewDescription); descr.setText(nullCheck(resincDescription.get(i), "None Added")); FetchableImageView image = (FetchableImageView) resourcelayout.findViewById(R.id.imgViewRes); image.setImage(resUrls.get(i), R.drawable.resourcedefault); resourcelayout.setTag(intial); imageViewCategory = (ImageView) resourcelayout.findViewById(R.id.imageViewCategory); imageViewCategory.setImageDrawable(getResources().getDrawable(R.drawable.exam_ico)); intial++; scrollChild.addView(resourcelayout, new LinearLayout.LayoutParams(250, 180)); resourcelayout.setPadding(10, 0, 10, 0); resourcelayout.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { int s = (Integer) v.getTag(); Log.i("Size completeGooruOid :", "" + examresGooruOid.size()); // Flurry Log flag_isPlayerTransition = true; resourceType = "Exam"; resourceGooruId = examresGooruOid.get(s); Intent intentResPlayer = new Intent(getBaseContext(), ResourcePlayer.class); Bundle extras = new Bundle(); extras.putInt("key", s); extras.putString("token", token); extras.putString("searchkey", searchKeyword); extras.putStringArrayList("goor", examresGooruOid); intentResPlayer.putExtras(extras); startActivity(intentResPlayer); } }); } }
From source file:org.ednovo.goorusearchwidget.SearchResults_resource.java
/** * @function name :createinteractiveLayout * /*w w w.j a v a 2 s . c om*/ * This function is used to add 5 more resources in horizontallist * view. * * @param 5 list(resUrls, resTitles, resCategory, resDescription, * resGooruOid); * * @return void * * */ // interactive public void createinteractiveLayout(List<String> resincUrls, List<String> resincTitle, List<String> resincCategory, List<String> resincDescription, List<String> resincGooruid) { LinearLayout scrollChild = (LinearLayout) findViewById(R.id.layoutInteractive); int size = resincUrls.size(); Log.i("Size to check :", "" + size); List<String> resTempincGooruid = new ArrayList<String>(); resTempincGooruid = resincGooruid; int intial = 0; if (interactiveresGooruOid.size() > 4) { intial = interactiveresGooruOid.size() - 5; } else { interactiveRight.setVisibility(View.GONE); } Log.i("intial", "" + intial); for (int i = 0; i < size; i++) { resourcelayout = LayoutInflater.from(this).inflate(R.layout.resource_view, null); TextView title = (TextView) resourcelayout.findViewById(R.id.textViewTitle); title.setText(nullCheck(resincTitle.get(i), "None Added")); TextView category = (TextView) resourcelayout.findViewById(R.id.textViewSource); category.setText(nullCheck(resincCategory.get(i), "None Added")); TextView descr = (TextView) resourcelayout.findViewById(R.id.textViewDescription); descr.setText(nullCheck(resincDescription.get(i), "None Added")); FetchableImageView image = (FetchableImageView) resourcelayout.findViewById(R.id.imgViewRes); image.setImage(resUrls.get(i), R.drawable.resourcedefault); resourcelayout.setTag(intial); imageViewCategory = (ImageView) resourcelayout.findViewById(R.id.imageViewCategory); imageViewCategory.setImageDrawable(getResources().getDrawable(R.drawable.interactive_ico)); intial++; scrollChild.addView(resourcelayout, new LinearLayout.LayoutParams(250, 180)); resourcelayout.setPadding(10, 0, 10, 0); resourcelayout.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { int s = (Integer) v.getTag(); Log.i("Size completeGooruOid :", "" + interactiveresGooruOid.size()); // Flurry Log flag_isPlayerTransition = true; resourceType = "Interactive"; resourceGooruId = interactiveresGooruOid.get(s); Intent intentResPlayer = new Intent(getBaseContext(), ResourcePlayer.class); Bundle extras = new Bundle(); extras.putInt("key", s); extras.putString("token", token); extras.putString("searchkey", searchKeyword); extras.putStringArrayList("goor", interactiveresGooruOid); intentResPlayer.putExtras(extras); startActivity(intentResPlayer); } }); } }
From source file:com.aliyun.homeshell.Folder.java
public void onAdd(ShortcutInfo item) { mItemsInvalidated = true;// ww w . ja va 2 s .com // If the item was dropped onto this open folder, we have done the work associated // with adding the item to the folder, as indicated by mSuppressOnAdd being set /* YUNOS BEGIN */ // ##date:2013/12/03 ##author:xiaodong.lxd // bug id:69270 mHasDirtyData = false; mDestroyed = false; /* YUNOS END */ if (mSuppressOnAdd) return; /* YUNOS BEGIN */ // ##date:2013/11/28 ##author:zhangqiang.zq // bug id:66131 if (item.container >= 0 && item.cellX >= 0 && item.cellY >= 0) { insertItem(item); return; } /* YUNOS END */ if (!findAndSetEmptyCells(item)) { // The current layout is full, can we expand it? setupContentForNumItems(getItemCount() + 1); findAndSetEmptyCells(item); } final long originalContainer = item.container; createAndAddShortcut(item); LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, item.screen, item.cellX, item.cellY); /*YUNOS BEGIN added by xiaodong.lxd : when add EditFolderIcon, need to run replaceFolderWithFinalItem*/ if (item.isEditFolderShortcut()) { mNeedReplaceFolderWithFinalItem = true; } /*YUNOS END*/ /* YUNOS BEGIN */ // ##date:2014/9/29 ##author:zhanggong.zg ##BugID:5244146 // Hideseat callback: drag icon from hide-seat to folder if (originalContainer == LauncherSettings.Favorites.CONTAINER_HIDESEAT) { Hideseat hideseat = mLauncher.getHideseat(); if (hideseat != null && !hideseat.isDraggingIconToFolder()) { // try to find corresponding view for the item View iconView = null; ShortcutAndWidgetContainer container = mContent.getShortcutAndWidgetContainer(); for (int i = 0; i < container.getChildCount(); i++) { View view = container.getChildAt(i); if (view.getTag() == item) { iconView = view; break; } } hideseat.onDragIconFromHideseatToFolder(iconView, item, this); } } /* YUNOS END */ }
From source file:com.aliyun.homeshell.Folder.java
public ArrayList<View> getItemsInReadingOrder(boolean includeCurrentDragItem) { if (mItemsInvalidated) { mItemsInReadingOrder.clear();// w ww . java 2 s . c o m int screenCount = mContentList.size(); for (int m = 0; m < screenCount; m++) { CellLayout mContent = mContentList.get(m); for (int j = 0; j < mContent.getCountY(); j++) { for (int i = 0; i < mContent.getCountX(); i++) { View v = mContent.getChildAt(i, j); if (v != null) { ShortcutInfo info = (ShortcutInfo) v.getTag(); /* YUNOS BEGIN */ // ##date:2013/11/25 ##author:xiaodong.lxd // add determine mDropAccepted if (info != mCurrentDragInfo || includeCurrentDragItem || !mDropAccepted /*YUNOS BEGIN*/ //##date:2014/06/18 ##author:guoshuai.lgs ##BugID: //support the folder feature in mainmenu // add all child view when the folder is in mainmenu. || (LauncherApplication.isMainmenuMode() && mInfo.isMainmenuFolder())) { /*YUNOS END*/ mItemsInReadingOrder.add(v); } /* YUNOS END */ } } } } mItemsInvalidated = false; } return mItemsInReadingOrder; }
From source file:com.android.leanlauncher.LauncherTransitionable.java
private void startAppShortcutOrInfoActivity(View v) { Object tag = v.getTag(); final ShortcutInfo shortcut; final Intent intent; if (tag instanceof ShortcutInfo) { shortcut = (ShortcutInfo) tag;/*www . ja v a 2 s . com*/ intent = shortcut.intent; int[] pos = new int[2]; v.getLocationOnScreen(pos); intent.setSourceBounds(new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight())); } else if (tag instanceof AppInfo) { shortcut = null; intent = ((AppInfo) tag).intent; } else { throw new IllegalArgumentException("Input must be a Shortcut or AppInfo"); } boolean success = startActivitySafely(v, intent, tag); if (success && v instanceof BubbleTextView) { mWaitingForResume = (BubbleTextView) v; mWaitingForResume.setStayPressed(true); } }
From source file:com.aliyun.homeshell.Folder.java
public void onClick(View v) { // close folder on click if (v == mFolderViewPager && !mLauncher.isGadgetCardShowing()) { mLauncher.closeFolder();//ww w . j a v a 2s . co m return; } Object tag = v.getTag(); if (tag instanceof ShortcutInfo) { // refactor this code from Folder ShortcutInfo item = (ShortcutInfo) tag; /* YUNOS BEGIN */ // ##date:2014/06/03 ##author:yangshan.ys // batch operations to the icons in folder if (item.isEditFolderShortcut()) { int[] position = new int[] { 0, 0 }; v.getLocationOnScreen(position); position[0] += ((BubbleTextView) v).getBUBBLE_WIDTH() / 2; position[1] += ((BubbleTextView) v).getBUBBLE_HEIGHT() / 2; showSelectApps(position); } else { /* YUNOS END */ /*YUNOS BEGIN*/ //##date:2013/11/28 ##author:xindong.zxd //update folder item status flag item.setIsNewItem(false); ((BubbleTextView) v).updateView(item); mLauncher.getModel().modifyItemNewStatusInDatabase(getContext(), item, false); mFolderIcon.invalidate(); /*YUNOS END*/ int[] pos = new int[2]; v.getLocationOnScreen(pos); item.intent .setSourceBounds(new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight())); /*YUNOS BEGIN*/ //##date:2013/12/6 ##author:xindong.zxd //avtivity switching when application update /*YUNOS BEGIN*/ //##date:2014/02/19 ##author:hao.liuhaolh ##BugID:92481 //vp install //item type vpinstall need to be checked before isDownloading if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_VPINSTALL) { mLauncher.getModel().startVPSilentInstall(item); } /*YUNOS END*/ else if (item.isDownloading()) { mLauncher.onDownloadingClick(v); } else { mLauncher.startActivitySafely(v, item.intent, item); /*YUNOS BEGIN*/ //##date:2014/8/1 ##author:zhangqiang.zq // favorite app, BugID:1033964 if (item.itemType == LauncherSettings.BaseLauncherColumns.ITEM_TYPE_APPLICATION) { ((LauncherApplication) mLauncher.getApplicationContext()).collectUsageData(item.id); } /* YUNOS END */ } /*YUNOS BEGIN*/ } } }
From source file:com.dattasmoon.pebble.plugin.EditNotificationActivity.java
@Override public boolean onOptionsItemSelected(MenuItem item) { if (Constants.IS_LOGGABLE) { Log.i(Constants.LOG_TAG, "Selected menu item id: " + String.valueOf(item.getItemId())); }//from w ww. ja v a 2 s . c o m final AlertDialog.Builder builder = new AlertDialog.Builder(this); View v; ListViewHolder viewHolder; AdapterView.AdapterContextMenuInfo contextInfo; String app_name; final String package_name; switch (item.getItemId()) { case R.id.btnUncheckAll: builder.setTitle(R.string.dialog_confirm_title); builder.setMessage(getString(R.string.dialog_uncheck_message)); builder.setCancelable(false); builder.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int buttonId) { if (lvPackages == null || lvPackages.getAdapter() == null || ((packageAdapter) lvPackages.getAdapter()).selected == null) { //something went wrong return; } ((packageAdapter) lvPackages.getAdapter()).selected.clear(); lvPackages.invalidateViews(); } }); builder.setNegativeButton(R.string.decline, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int buttonId) { //do nothing! } }); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.show(); return true; case R.id.btnSave: finish(); return true; case R.id.btnDonate: Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(Constants.DONATION_URL)); startActivity(i); return true; case R.id.btnSettings: Intent settings = new Intent(this, SettingsActivity.class); startActivity(settings); return true; case R.id.btnRename: contextInfo = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); int position = contextInfo.position; long id = contextInfo.id; // the child view who's info we're viewing (should be equal to v) v = contextInfo.targetView; app_name = ((TextView) v.findViewById(R.id.tvPackage)).getText().toString(); viewHolder = (ListViewHolder) v.getTag(); if (viewHolder == null || viewHolder.chkEnabled == null) { //failure return true; } package_name = (String) viewHolder.chkEnabled.getTag(); builder.setTitle(R.string.dialog_title_rename_notification); final EditText input = new EditText(this); input.setHint(app_name); builder.setView(input); builder.setPositiveButton(R.string.confirm, null); builder.setNegativeButton(R.string.decline, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //do nothing } }); final AlertDialog d = builder.create(); d.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Button b = d.getButton(AlertDialog.BUTTON_POSITIVE); if (b != null) { b.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //can't be nothing if (input.getText().length() > 0) { if (Constants.IS_LOGGABLE) { Log.i(Constants.LOG_TAG, "Adding rename for " + package_name + " to " + input.getText()); } JSONObject rename = new JSONObject(); try { rename.put("pkg", package_name); rename.put("to", input.getText()); arrayRenames.put(rename); } catch (JSONException e) { e.printStackTrace(); } ((packageAdapter) lvPackages.getAdapter()).notifyDataSetChanged(); d.dismiss(); } else { input.setText(R.string.error_cant_be_blank); } } }); } } }); d.show(); return true; case R.id.btnRemoveRename: contextInfo = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); // the child view who's info we're viewing (should be equal to v) v = contextInfo.targetView; app_name = ((TextView) v.findViewById(R.id.tvPackage)).getText().toString(); viewHolder = (ListViewHolder) v.getTag(); if (viewHolder == null || viewHolder.chkEnabled == null) { if (Constants.IS_LOGGABLE) { Log.i(Constants.LOG_TAG, "Viewholder is null or chkEnabled is null"); } //failure return true; } package_name = (String) viewHolder.chkEnabled.getTag(); builder.setTitle( getString(R.string.dialog_title_remove_rename) + app_name + " (" + package_name + ")?"); builder.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (Constants.IS_LOGGABLE) { Log.i(Constants.LOG_TAG, "Before remove is: " + String.valueOf(arrayRenames.length())); } JSONArray tmp = new JSONArray(); try { for (int i = 0; i < arrayRenames.length(); i++) { if (!arrayRenames.getJSONObject(i).getString("pkg").equalsIgnoreCase(package_name)) { tmp.put(arrayRenames.getJSONObject(i)); } } } catch (JSONException e) { e.printStackTrace(); } arrayRenames = tmp; if (Constants.IS_LOGGABLE) { Log.i(Constants.LOG_TAG, "After remove is: " + String.valueOf(arrayRenames.length())); } ((packageAdapter) lvPackages.getAdapter()).notifyDataSetChanged(); } }); builder.setNegativeButton(R.string.decline, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //do nothing } }); builder.show(); return true; } return super.onOptionsItemSelected(item); }