本文共 901 字,大约阅读时间需要 3 分钟。
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { System.out.println(id); System.out.println(files[(int)id].getAbsolutePath()); mp3Player = new MP3Player(MainActivity.this); mp3Player.init(files[(int)id].getName()); mp3Player.play(); } }); listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { //长按事件 @Override public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { System.out.println("22222222222222222222222222222222"); System.out.println(files[(int)id].getAbsolutePath()); return true; } });
转载地址:http://wjqdy.baihongyu.com/