我正在使用 listview ...我尝试在 itemclicked 列表时打开图像并且在另一个活动中进行 diaply ...但它不工作...如果你知道的朋友请帮助我...谢谢....
@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>