Quantcast
Channel: 質問!ITmedia 新着質問(Java/253)
Viewing all articles
Browse latest Browse all 2439

Androidでjcifsを用いた画像の表示

$
0
0
現在,Android4.4.2の端末にLANで接続されたWindowsPC内の画像ファイルを表示しようとしています. 下記のようにファイルの存在を確認してからimageViewに表示させようとしており、ファイルがあればfile.exists()はtrueを返し、なければfalseを返すことから、ファイルの存在の確認は問題なく行えていることはわかりました. しかし,デコードする部分でFileNotFoundExceptionが発生してしまいます. 処理はAsyncTaskのdoingBackGroud内で行っています. try { SmbFile file = new SmbFile("smb://mypc:7360@192.168.11.15/Users/mypc/test.bmp/"); if (file.exists()){ Log.e(TAG,"OK"); }else{ Log.e(TAG,"NO"); } Bitmap originalImage = BitmapFactory.decodeFile(file.getPath()); iv1.setImageBitmap(originalImage); } catch (Exception e ) { e.printStackTrace(); } このような場合、何が原因であると考えられるでしょうか? お分かりになられる方がいらっしゃいましたら何卒ご教授宜しく御願い致します.

Viewing all articles
Browse latest Browse all 2439

Trending Articles