03 2014 档案
摘要:Intent intent=new Intent(Intent.ACTION_GET_CONTENT);//ACTION_OPEN_DOCUMENT intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("image/jpeg"); if(android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.KITKAT){ startActivityForResult(intent, SELECT_PIC_KI...
阅读全文
摘要:在通过BitmapFactory.decodeFile(String path)方法将突破转成Bitmap时,遇到大一些的图片,我们经常会遇到OOM(Out Of Memory)的问题。怎么避免它呢? 这就用到了我们上面提到的BitmapFactory.Options这个类。BitmapFactory.Options这个类,有一个字段叫做inJustDecodeBounds。SDK中对这个成员的说明是这样的: If set to true, the decoder will return null (no bitmap), but the out… 也就是说,如果我们把它设为true,那么Bi
阅读全文
摘要:系统已经有的东西,如果我们没有新的需求的话,直接调用是最直接的。下面讲讲调用系统相机拍照并保存图片和如何调用系统相册的方法。首先看看调用系统相机的核心方法:Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);startActivityForResult(camera, 100);相机返回的数据通过下面的回调方法取得,并处理@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActiv.
阅读全文

浙公网安备 33010602011771号