-1
나는 목록을 설정하는 코드를 작성했습니다. 클릭 가능한 목록이 필요합니다. perticular 항목을 클릭 할 때 clickable.Whan을 클릭해야합니다. 그러면 몇 가지 작업을 클릭합니다. 버튼을 클릭 할 때 다른 동작이 발생해야합니다.클릭 가능한 목록을 설정하려면
내 코드는보기 unClickable 것 목록보기 항목에서 버튼을 갖는
public class Downloadlist extends ListActivity {
private List<String> item = null;
private List<String> path = null;
private String root="/sdcard";
private TextView myPath;
ListView lv1;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mydownload);
myPath = (TextView)findViewById(R.id.path);
lv1=(ListView)findViewById(R.id.list);
getDir(root);
}
private void getDir(String dirPath)
{
myPath.setText("Location: " + dirPath);
item = new ArrayList<String>();
path = new ArrayList<String>();
File f = new File(dirPath);
File[] files = f.listFiles();
if(!dirPath.equals(root))
{
item.add(root);
path.add(root);
item.add("../");
path.add(f.getParent());
}
for(int i=0; i < files.length; i++)
{
File file = files[i];
path.add(file.getPath());
if(file.isDirectory())
item.add(file.getName() + "/");
else
item.add(file.getName());
}
Log.d("itemssssssss", item.toString());
ArrayAdapter<String> fileList =
new ArrayAdapter<String>(this, R.layout.rowmydownload,R.id.rowtext, this.item);
setListAdapter(fileList);
}
}