@Override public boolean onItemLongClick(AdapterView<?> arg0, View arg1, final int arg2, long arg3) { // TODO Auto-generated method stub new AlertDialog.Builder(SdcardActivity.this) .setIcon(android.R.drawable.ic_dialog_alert) .setTitle("温馨提示") .setMessage("您真的要删除这个图片吗") .setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub File file=new File(Constants.path+imageNames[arg2]); if(file.exists()){ file.delete(); } } }) .setNegativeButton("取消", null) .show(); return true; }