進出口新到Android ..如何將選定的值傳遞給另一個活動?
林意圖面臨的問題..
我的問題是...我想從一個活動的字符串數組列表選擇的值傳遞用戶到另一個活動...值是通過JSON從數據庫中處理的字符串。和值存儲在一個ArrayList中..
現在我需要從一個活動傳遞值使用意圖another..by ..
lvForDialog = (ListView) viewList.findViewById(R.id.List_view); ArrayAdapter<String> adapter = (new ArrayAdapter<String>(Nexttopic.this, R.layout.row_topic, R.id.child_row,tnamelist)); lvForDialog.setAdapter(adapter); lvForDialog.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position,long id) { Intent intent = new Intent(Nexttopic.this,Question.class); intent.putExtra(TAG_TOPICNAME, tname);
我想通過TAG_TOPICNAME
到另一個活動..哪個主題名稱用戶選擇我想通過的名稱...
如何做到這一點?
非常感謝..
你一定要看到這個鏈接: - –
duggu
@hcd thats for button ...我需要onItemclickListener ... –
感謝all..for回答我的問題..並指導我... –