0

With this piece of code I can show the images in the gallery in my activity

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.message_main);

        Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);
        photoPickerIntent.setType("image/*");
        startActivityForResult(photoPickerIntent, 1);
    }

the layout looks like this

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >



</RelativeLayout>

What I don't know how to do is wire up a long click to an image? So when a user long click the image in my actiivy I want to capture which image was clicked and process it. Find it's path, type of image etc. Based on my layout I"m not sure what I would wire up to capture this long click?

stack
  • 613
  • 10
  • 20

1 Answers1

0

You need to use Context menu for gallery view.

For more Info on Context menu: http://developer.android.com/reference/android/view/ContextMenu.html

Android - EditTexts in Gallery show strange behaviour when being (long)-clicked

Hope this helps

Community
  • 1
  • 1
Chaitu
  • 907
  • 2
  • 13
  • 27