单击listView时不显示任何值

时间:2016-01-02 09:56:04

标签: android listview android-listview position

表工作详情

enter image description here

按给定条件$sql = "select * from work_details WHERE twd= '". $id."'";加载到listView中//假设$ id等于1。

enter image description here

点击listView后,它会显示其ID。但没有显示任何价值。

    listViewUpdate.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> listView, View view,
                                int position, long id) {
            mClickedPosition = position;
            HashMap<String, String> clickedItem = EditDetails.get(position);
            iD=clickedItem.get(Config.TAG_ID);
            Toast.makeText(getActivity(),iD,Toast.LENGTH_LONG).show();
           // Toast.makeText(getActivity(), iD + "", Toast.LENGTH_LONG).show();
        }
    });

1 个答案:

答案 0 :(得分:0)

将SQL查询更改为:

$sql = "SELECT * FROM work_details WHERE twd='$id'";