当我在应用程序中从图库上传图像但选择一些图像时出现此异常。
android.view.WindowLeaked: Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4133c7d8 that was originally added here
android.view.WindowManagerImpl.addView(Win
dowManagerImpl.java:152)我没有;为什么我随机得到异常?
此代码用于开放画廊..
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
((Activity) context).startActivityForResult(Intent.createChooser(intent,"Select Picture"), PICK_FROM_FILE);
下面的代码用于从画廊 i 获取 bimap
f (resultCode == RESULT_OK )
{
Uri contentUri = data.getData();
System.out.println("**************contentUri***************"+contentUri);
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(contentUri, proj, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
String tmppath = cursor.getString(column_index);
// File abc= new File(tmppath);
System.out.println("**************tmppath***************"+tmppath);
Bitmap mBitmap = BitmapFactory.decodeFile(tmppath);
// Bitmap bitmap = BitmapFactory.decodeFile(abc);
System.out.println("**************mBitmap(gallery)***************"+mBitmap);
Court_formations objectdat =new Court_formations();
objectdat.showGalleryimage(getDialogContext(),mBitmap);
请帮助