1
我想設置使用Intent.ACTION_GET_CONTENT視圖背景圖像後改變和處理onActivityResult方法...形象定位得到選擇
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK && requestCode == SELECT_PICTURE) {
Uri selectedImageUri = data.getData();
try {
InputStream inputStream =
getContentResolver().openInputStream(selectedImageUri);
Drawable drawable = Drawable.createFromStream(inputStream,
selectedImageUri.toString());
mView.setBackground(drawable);
} catch(FileNotFoundException e) {}
}
}
它正常工作,從GALLARY一些圖片,但並不適用於所有圖片。選擇某些圖像後,圖像方向會發生變化。
默認圖像取向在許多手機三星特別景觀。在顯示圖像之前,您需要檢查圖像中的exif旋轉標籤 –
請看我的答案:http://stackoverflow.com/questions/14066038/why-image-captured-using-camera-intent-gets-rotated-on -some-devices-in-android –