|
|
???????????????????
????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????PK????
???????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????? ???????
??????Mac????Win7?????????????DSM??????????????????????
??1?instant search?????????????????????????????????????????????????????????????????????????????????
??2??????????????????????????????+????????????
??3???????????????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????
?????????????????????
???/??/?????
???DSM?????? Android????????????Astro??????RootExplorer??????ES????????????????????????????
Astro????????????????????????????????????????????????????????????
RootExplorer?????????????????????????????????????????????????
ES?Astro???????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???android ??????????
android ??????????
??android?????????????????????????????????????????.
????FileManagerActivity?????
packagecom.hoperun.activity;
importjava.io.File;
importjava.util.ArrayList;
importandroid.app.AlertDialog;
importandroid.app.ListActivity;
importandroid.content.DialogInterface;
importandroid.content.Intent;
importandroid.content.DialogInterface.OnClickListener; importandroid.net.Uri;
importandroid.os.Bundle;
importandroid.view.LayoutInflater;
importandroid.view.View;
importandroid.widget.EditText;
importandroid.widget.ListView;
importandroid.widget.TextView;
importcom.hoperun.adapter.FileListAdapter;
public class FileManagerActivity extends ListActivity { /** Called when the activity is first created. */
private TextViewshowXPath;// ????????
private ArrayList<String> items;// ???????
private ArrayList<String> paths;// ??????
private String rootPath = "/";// ???
private View renameDialogView;// ????????
privateEditTextnameEdit;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
showXPath = (TextView) findViewById(R.id.xPath);
getFileDir(rootPath);// ??????
}
// ????????
private void getFileDir(String path) {
showXPath.setText(path);//??????
items = new ArrayList<String>();
paths = new ArrayList<String>();
// ??????????
File presentFile = new File(path);
File[] files = presentFile.listFiles();
if (! path.equals(rootPath)) {
// ?????
items.add("back to /");
paths.add(rootPath);
// ???????
items.add("back previous");
paths.add(presentFile.getParent());
}
// ?????????????????
for (File f : files) {
items.add(f.getName());
paths.add(f.getPath());
}
// ???????
setListAdapter(new
FileListAdapter(FileManagerActivity.this, items, paths)); }
// List?item?????
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
File f = new File(paths.get(position));
if (f.isDirectory()) {
getFileDir(paths.get(position));
} else {
fileHandle(f);
}
}
// File??????
private void fileHandle(final File f) {
// ???????????????item????????
OnClickListenerclickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (which == 0) {// ????
openFile(f);
} else if (which == 1) {// ?????
// ??????????
LayoutInflaterrenameInflater = LayoutInflater .from(FileManagerActivity.this);
renameDialogView = renameInflater.inflate( R.layout.rename_alert_dialog, null);
nameEdit = (EditText) renameDialogView.findViewById(R.id.nameEdit);
// ???????????
nameEdit.setText(f.getName());
// ???????????????????????????????
OnClickListenerrenameDialogListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String nameEditStr = nameEdit.getText().toString();// ??????????????
final String postRenamedFilePath = f.getParentFile().getPath()
+ "/" + nameEditStr;// ?????????
if (new File(postRenamedFilePath).exists()) {// ????????????????
// ???????????????????if (! nameEditStr.equals(f.getName())) {
newAlertDialog.Builder(FileManagerActivity.this)
.setTitle("??").setMessage("????????????")
.setPositiveButton("??", new
DialogInterface.OnClickListener() {
// ?????????????public void onClick(DialogInterface dialog, int which) {
f.renameTo(new
File(postRenamedFilePath));// ???????
getFileDir(f.getParent());// ????????
}
}).setNegativeButton("??", new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dialog,
int which) {
}
}).show();
}
} else {
f.renameTo(new
File(postRenamedFilePath));// ???????
getFileDir(f.getParent());// ????????
}
}
};
// ??????
AlertDialogrenameDialog=
newAlertDialog.Builder(FileManagerActivity.this).create();
renameDialog.setView(renameDialogView);// ???????????
renameDialog.setButton("??", renameDialogListener);
renameDialog.setButton2("??", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
renameDialog.show();
} else {
// ?????????
new
AlertDialog.Builder(FileManagerActivity.this).setTitle("??") .setMessage("??????????").setPositiveButton("??", new DialogInterface.OnClickListener() {
// ??????
public void onClick(DialogInterface dialog,
int which) {
f.delete();// ????
getFileDir(f.getParent());
}
}).setNegativeButton("??", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
}
}).show();
}
}
};
// ??listDialog,?????
String[] operas = new String[] {"open", "rename", "delete"};newAlertDialog.Builder(FileManagerActivity.this)
.setTitle("operator dialog").setItems(operas, clickListener)
.setNegativeButton("??", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int
?????????????????????????
??????????????????????
??????:??????????????????????????????????????????
??????????
??????????????????????????? 3D?????.??????????????
???????finger print security scanner?
???????????????????????????????????????????????????????????
??????:??????????????????flv????????????????????????????????????????????????????
?????????????????????????????????
??????????????????OCR???????????????
?
??????YY?????phonebook?QQ2012???? ?????wifi???????????????????????????
????????????????????????????????wifi
????????wifi?????????????????????
?????????????????????????????????
?????????????????????????
???????360?????360??????????????
?????360??????115???QQ????????cloud+?????
???
??PC????pc?QQ??????????????????????????
??????usb???wifi???????????????????360????????????????????????
????????????:??3??????????????
?????http://www.850500.com/news/69537.html
?????,??! |
|