teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

情報を最新のものに更新しました

2015/08/13 05:23

投稿

moupai
moupai

スコア24

title CHANGED
File without changes
body CHANGED
@@ -83,7 +83,12 @@
83
83
 
84
84
  //以下のように書いてみましたがエラーで動きませんでした。。
85
85
  ParseFile file = object.getParseFile("couple.jpg");
86
+ byte[] bytes = new byte[0];
87
+ try {
86
- byte[] bytes = file.getData();
88
+ bytes = file.getData();
89
+ } catch (ParseException e1) {
90
+ e1.printStackTrace();
91
+ }
87
92
  Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
88
93
  ImageView iv = (ImageView) findViewById(R.id.iv);
89
94
  iv.setImageBitmap(bitmap);
@@ -110,6 +115,6 @@
110
115
 
111
116
  ```
112
117
 
113
- ![イメージ説明](c8af1a049c4cac9de69d52445a89cbc1.png)
118
+ ![イメージ説明](1cf6ad5d59fe048a3f6e4aebc3997ccd.png)
114
119
 
115
120
  よろしくお願いします。

3

最新のエラー表示に変更しました。

2015/08/13 05:23

投稿

moupai
moupai

スコア24

title CHANGED
File without changes
body CHANGED
@@ -82,9 +82,11 @@
82
82
  tv.setText(title);
83
83
 
84
84
  //以下のように書いてみましたがエラーで動きませんでした。。
85
+ ParseFile file = object.getParseFile("couple.jpg");
86
+ byte[] bytes = file.getData();
87
+ Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
85
- ImageView iv = (ImageView)findViewById(R.id.iv);
88
+ ImageView iv = (ImageView) findViewById(R.id.iv);
86
- ImageView image = object.getParseFile("couple.jpg");
87
- image.setImageResource(image);
89
+ iv.setImageBitmap(bitmap);
88
90
 
89
91
 
90
92
 
@@ -108,6 +110,6 @@
108
110
 
109
111
  ```
110
112
 
111
- ![イメージ説明](40d30866f8a5b9f3bd9872ddfd7e8354.png)
113
+ ![イメージ説明](c8af1a049c4cac9de69d52445a89cbc1.png)
112
114
 
113
115
  よろしくお願いします。

2

エラー文をアップさせて頂きました。

2015/08/13 04:50

投稿

moupai
moupai

スコア24

title CHANGED
File without changes
body CHANGED
@@ -108,4 +108,6 @@
108
108
 
109
109
  ```
110
110
 
111
+ ![イメージ説明](40d30866f8a5b9f3bd9872ddfd7e8354.png)
112
+
111
113
  よろしくお願いします。

1

題名を分かりやすくしました。

2015/08/13 04:28

投稿

moupai
moupai

スコア24

title CHANGED
@@ -1,1 +1,1 @@
1
- パースでの画像取得
1
+ Android - パースでの画像取得
body CHANGED
File without changes