Question: I am trying to fetch pictures from different applications through intent.

I am using the following code:

```
    Intent intent = new Intent("android.intent.action.GET_CONTENT");

    intent.addCategory("android.intent.category.OPENABLE");
    intent.setType("image/*");

```

Interestingly this works fine on Google Nexus 7 Android 4.4, but for other devices (Android 4.2.2) it allows me to select all kinds of files, like videos and .docx

Why is it happening so?

Edit
----

To be clear, what I am expecting is it should restrict me from choosing files other than image type. But this is not happening.

Answer: 
```
final static int IMPORT_PICTURE = 10001;
Intent intent = new Intent();
intent.setType("image/*"); //For specific type add image/jpeg
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), IMPORT_PICTURE);

```
Here's what I've found that worked for me:

```
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class StackOverflowAppActivity extends Activity {
    private final int PICK_IMAGE = 0;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
        startActivityForResult(i, PICK_IMAGE);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        switch (requestCode) {

        case PICK_IMAGE:
            if (resultCode == RESULT_OK) {
                // do your thing
            }
        }
    }
}

```

This is a solution taken from [here](https://stackoverflow.com/questions/6484228/startactivityforresult-does-not-returns-anything-image-picking-from-a-preferenc) by [evilone](https://stackoverflow.com/users/526217/evilone)