2011-04-07 68 views
0

親愛的......先生/ MAM,在我的應用程序中每個列表項的位置有不同的性反應的ID ..我想根據位置DISPLY是性反應的ID的吐司消息點擊它意味着包該響應ID根據位置該怎麼做...先生我是新的Android的所以用代碼描述..我附上我的一些代碼,所以請在其上添加neccesery代碼...請提前致謝在列表視圖點擊顯示不同-2活性

@Override 
    **protected void onListItemClick(ListView l, View v, int position, long id) 
    { 
     super.onListItemClick(l, v, position, id); 
     **String responceid = Activity2.getData();** 

     Object o = (String) (Notepadv3.this).getListAdapter().getItem(position);** 

     Toast.makeText(this, "this row responce id is= " + " " + , Toast.LENGTH_LONG).show(); 



} 
+0

限制從女性開發人員響應您的可能性?爲什麼先生? – Jana 2011-04-07 11:13:56

回答

0

嘗試Toast.makeText(this, "this row responce id is= " + responceid + , Toast.LENGTH_LONG).show();

+0

我有每個listview的responceid different-2當我點擊listview顯示自己的responce id String responceid = Activity2.getData(); – user690575 2011-04-07 11:06:19

+0

檢查編輯的代碼 – pankajagarwal 2011-04-07 12:04:42

0

在String類型的ArrayList中有您的響應。

ArrayList respCode<String> =new Arraylist<String>(); 
respCode.add("RESPONSE 1"); 
respCode.add("RESPONSE 2"); 

然後在列表視圖itemClickListner

@Override 
    public void onItemClick(AdapterView<?> a, View v, int position, long id) { 

    Toast.makeText(this,respCode.get(position), Toast.LENGTH_LONG).show(); 
    } 
+0

我有響應在類型字符串.... – user690575 2011-04-07 11:27:40

+0

是的ArrayList的類型字符串..你可以添加字符串 – Jana 2011-04-07 12:11:16

相關問題