Example #1
0
 public void menuClick(int which) {
   switch (which) {
     case 1:
       if (Util.existSDcard()) {
         Intent intent = new Intent(); // 调用照相机
         String messagepath = StaticFactory.APKCardPath;
         File fa = new File(messagepath);
         if (!fa.exists()) {
           fa.mkdirs();
         }
         fragment.cameraPath = messagepath + new Date().getTime(); // 图片路径
         intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(fragment.cameraPath)));
         intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
         startActivityForResult(intent, AddPicFragment.Camera);
       } else {
         Toast.makeText(getApplicationContext(), "亲,请检查是否安装存储卡!", Toast.LENGTH_SHORT).show();
       }
       break;
     case 0:
       if (Util.existSDcard()) {
         String messagepath = StaticFactory.APKCardPath;
         File fa = new File(messagepath);
         if (!fa.exists()) {
           fa.mkdirs();
         }
         PhotoAlbumMainActivity_.intent(this)
             .maxnum(6)
             .paths(fragment.getSdibs())
             .startForResult(AddPicFragment.Album);
       } else {
         Toast.makeText(getApplicationContext(), "亲,请检查是否安装存储卡!", Toast.LENGTH_SHORT).show();
       }
       break;
   }
 }