KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to draw selector on long press as shown in the picture. When I do long press on one item, the CAB menu is activated. But the list selector indicator goes off once after clicking. I want that list selectors to be active till the CAB menu is active for allowing multiple selection. And the color should toggle if I do double tap. This code works as a flicker when I click on it. Any one faced similar thing? Is there a hack to bring this functionality? Gridview with multiple selection: GridView setchoice in my OnCreate: gridView.setChoiceMode(GridView.CHOICE_MODE_MULTIPLE_MODAL); gridView.setMultiChoiceModeListener(new MultiChoiceModeListener()); This is working fine: gridView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { ImageView iv = (ImageView) v .findViewById(R.id.imageview2); ViewGroup gridChild = (ViewGroup) gridView .getChildAt(position); ViewGroup gridGrandChild = (ViewGroup) gridChild .getChildAt(0); ViewGroup gridGreatGrandChild = (ViewGroup) gridGrandChild .getChildAt(0); int childSize = gridGreatGrandChild.getChildCount(); if (iv.getId() == gridGreatGrandChild.getChildAt(1) .getId()) { if (iv.getVisibility() == 4) iv.setVisibility(View.VISIBLE); else iv.setVisibility(View.INVISIBLE); } }}); I am trying to implement the same code inside the MultiChoiceModeListener() class after the CAB menu is activated. Copied the same code inside public void
Tags (comma-separated)
Save Edits
Cancel