📜  android java 从 listview 项中获取值 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:03.643000             🧑  作者: Mango

代码示例1
lv.setOnItemClickListener(new OnItemClickListener() {
    public void onItemClick(AdapterView parent, View view,
        int position, long id) {
      // When clicked, show a toast with the TextView text
      Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
          Toast.LENGTH_SHORT).show();
    }
  });