I`m trying to open a image folder in native android gallery. This is my 
code:

File folder = new File("/sdcard/myfolder/");
SCAN_PATH=Environment.getExternalStorageDirectory().toString()+"/myfolder/"+allFiles[0];

private void startScan() { 
if (conn != null) {
conn.disconnect();
}
conn = new MediaScannerConnection(this, this);
conn.connect();
}

@Override
public void onMediaScannerConnected() { 
conn.scanFile(SCAN_PATH, "image/*");
}

@Override
public void onScanCompleted(String path, Uri uri) {
try {
Log.d("onScanCompleted", uri + "success" + conn);
if (uri != null) {
Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(uri);
    startActivity(intent);
}
} finally {
conn.disconnect();
conn = null;
}
}


Insede onScanCompleted I receve uri = 
content://media/external/images/media/267830 and a path not null too
the problem is: when I call "startActivity(intent);" I receive this error:
No Activity found to handle Intent android.intent.action.VIEWFailed to get 
type for: content://media/external/images/media/267830 (Unknown URL : 
content://media/external/images/media/267830)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to