I poured similar questions, but I can not find the answer. I want to be able to click on the images uploaded by the user for a long time in my web browser to save them (for example, you can in the browser). Any help?
Update:
Now the context menu appears with its own "Save Image" element. I can even successfully restart msgs. How can i save the image? Is an image that has been pressed for a long time transferred to my menu item?
public boolean onLongClick(View v) { openContextMenu(v); return true; } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.context, menu); } @Override public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { case R.id.save_image: Toast.makeText(this, "save failed", Toast.LENGTH_LONG).show(); return true; default: return super.onContextItemSelected(item); } }
source share