当前位置: 代码迷 >> Android >> Android 调用系统 相本代码
  详细解决方案

Android 调用系统 相本代码

热度:77   发布时间:2016-05-01 12:39:52.0
Android 调用系统 相册代码
 Button button = (Button) this.findViewById(R.id.huangliao);
       
        button.setOnClickListener(new OnClickListener() {
   
   @Override
   public void onClick(View arg0) {
    // TODO Auto-generated method stub
     String value = String.valueOf(Environment.getExternalStorageDirectory()+"/DCIM/Camera");
     File file = new File(value);
     Intent intent = new Intent();
     intent.setAction(android.content.Intent.ACTION_VIEW);
     intent.setDataAndType(Uri.fromFile(file), "image/*");
     startActivity(intent);
   }
  });
  相关解决方案