4 |
import android.content.Intent; |
import android.content.Intent; |
5 |
import android.net.Uri; |
import android.net.Uri; |
6 |
import android.os.Bundle; |
import android.os.Bundle; |
|
import android.util.Log; |
|
7 |
import android.view.View; |
import android.view.View; |
8 |
import android.widget.AdapterView; |
import android.widget.AdapterView; |
9 |
import android.widget.GridView; |
import android.widget.GridView; |
26 |
gridview.setOnItemClickListener(new OnItemClickListener() { |
gridview.setOnItemClickListener(new OnItemClickListener() { |
27 |
public void onItemClick(AdapterView<?> parent, View v, int position, long id) { |
public void onItemClick(AdapterView<?> parent, View v, int position, long id) { |
28 |
String uri = "file://" + images.getImagePath(position); |
String uri = "file://" + images.getImagePath(position); |
|
Log.i("VIEW", "URI=" + uri); |
|
29 |
|
|
30 |
Intent i = new Intent(Intent.ACTION_VIEW); |
Intent i = new Intent(Intent.ACTION_VIEW); |
31 |
i.setDataAndType(Uri.parse(uri), "image/png"); |
i.setDataAndType(Uri.parse(uri), "image/jpeg"); |
32 |
|
|
|
|
|
|
Log.i("VIEW", "" + position + " : " + images.getImagePath(position) + " : " + i.getAction() + " / " + i.getData()); |
|
33 |
startActivity(i); |
startActivity(i); |
34 |
} |
} |
35 |
}); |
}); |