Example #1
0
 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
   FileBean temp = mFileListFilter.get(position);
   if (temp != null) {
     final File mFile = temp.getFile();
     SysEng.getInstance().addEvent(new FavoriteFileEvent(m_act, temp, 1));
     // 如果该文件是可读的,我们进去查看文件
     if (mFile.isDirectory()) {
       if (mFile.canRead()) {
         FileManager.getInstance().setFilePath(mFile.getPath());
         KMainPage.mKMainPage.ChangePage(KMainPage.Local, null);
       } else { // 如果该文件不可读,我们给出提示不能访问,防止用户操作系统文件造成系统崩溃等
         Toast.makeText(m_act, "该文件夹不存在或权限不够!", Toast.LENGTH_SHORT).show();
       }
     } else {
       if (mFile.canRead()) {
         if (!mFile.exists()) {
           Toast.makeText(m_act, "未找到该文件!", Toast.LENGTH_SHORT).show();
           return;
         }
         SysEng.getInstance().addHandlerEvent(new openDefFileEvent(m_act, mFile.getPath()));
       } else { // 如果该文件不可读,我们给出提示不能访问,防止用户操作系统文件造成系统崩溃等
         Toast.makeText(m_act, "对不起,访问权限不够!", Toast.LENGTH_SHORT).show();
       }
     }
   }
 }
Example #2
0
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.btCopy:
       SysEng.getInstance().addHandlerEvent(new copyFileEvent(m_act, mFileListFilter, this));
       break;
     case R.id.btCut:
       SysEng.getInstance().addHandlerEvent(new cutFileEvent(m_act, mFileListFilter, this));
       break;
     case R.id.btDelete:
       deletefiles();
       break;
     case R.id.btSelectAll:
       SelectAll();
       break;
     case R.id.btBack:
       m_act.onKeyDown(KeyEvent.KEYCODE_BACK, new KeyEvent(1, 1));
       break;
   }
 }
Example #3
0
 public void NotifyDataSetChanged(int cmd, Object value) {
   mNotifyData.setKey(cmd);
   mNotifyData.setValue(value);
   SysEng.getInstance().addHandlerEvent(mNotifyData);
 }