public void onClick(View v) { switch (v.getId()) { case R.id.btn_scan_add: //添加扫描目录 Intent addit=new Intent(ScanDirectoryActivity.this,ScanMusicActivity.class); addit.putExtra("rs", adapter.getCheckFilePath()); setResult(ScanMusicActivity.SCAN_MUSIC_OK, addit); finish(); break; case R.id.btn_scan_directory_goup: //判断是否是父级目录 if(!currrentFile.getPath().toLowerCase().equals(rootFilePath)){ currrentFile=currrentFile.getParentFile(); getFilePath(currrentFile); adapter.notifyDataSetChanged(); } break; case R.id.btn_scan_back: setResult(-1); finish(); break; default: break; } }
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //进入下一级目录 currrentFile=files[position]; rs=adapter.getCheckFilePath(); getFilePath(currrentFile); adapter.notifyDataSetChanged(); }