馬上加入Android 台灣中文網,立即免費下載應用遊戲。
您需要 登錄 才可以下載或查看,沒有帳號?註冊
x
小弟想選取手機內相片並顯示在imgaeview上,不料有些照片無法顯示出來(desire 816後鏡所拍的照片不行前鏡可以)。
以測試過其他機型HTC 蝴蝶可以。
不知道問題是出在哪裡,請各位大大幫忙解惑。
以下為取出照片
testtbtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO 自動產生的方法 Stub
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), SELECT_PICTURE);
}
});
顯示imgaeview
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
testI= (ImageView) findViewById(R.id.imagetestt01);
if(resultCode == RESULT_OK){
Uri selectedImage = imageReturnedIntent.getData();
testI.setImageURI(selectedImage);
// 其他
}
}
|