私はリストビューを使用しています...アイテムがリストでクリックされ、別のアクティビティでダイアリーになっているときに画像を開こうとします...しかし、うまくいきません...あなたが知っている友人なら助けてください...ありがとう....
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Find the ListView resource.
mainListView = (ListView) findViewById( R.id.mainListView );
mainListView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> mainListView, View view, int pos,
long id) {
//Object obj = getFilesDir().getPath();
//String value= obj.toString();
Intent intent= new Intent(SimpleListViewActivity.this,Nextclass.class);
final String root = Environment.getExternalStorageDirectory().getAbsolutePath();
intent.setData(Uri.parse(root + "/mnt/sdcard/dcim/100andro/koala_copy.jpg"));
startActivity(intent);
}
private ArrayAdapter<String> getListAdapter() {
// TODO Auto-generated method stub
return null;
}
私のmain.xmlは
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/mainListView">
</ListView>
</LinearLayout>