2012-12-05 94 views
0

我已經添加APK擴展文件,併成功地上傳和dwonloaded,和我無法使用無法從下載的APK擴展文件

我的擴展文件包含圖像訪問他們獲得的圖像,whuile上傳我已經來所做的一切拉鍊和upoloaded ..

下面

是我的代碼從擴展文件的圖片...

任何人都可以請幫我..我怎樣才能得到的圖像

ZipResourceFile expansionFile = APKExpansionSupport 
       .getAPKExpansionZipFile(context, 1, 0); 

// Get an input stream for a known file inside the expansion file 
// ZIPs 

InputStream is = expansionFile.getInputStream("95065668.jpg"); 
Log.d(TAG, 
     "Assigning obb image to preview image::::::::::::" 
      + is.available()); 
BitmapFactory.Options bfo = new BitmapFactory.Options(); 
bfo.inPreferredConfig = Bitmap.Config.ARGB_8888; 
Bitmap b = BitmapFactory.decodeStream(is, null, bfo); 
+0

您是否收到任何錯誤?你的LogCat輸出是什麼意思?我們需要更多信息來進行工作。 –

+0

我得到空指針exceptioin ...輸入流爲空 – user1878115

回答

1

差不多你已經完成了,閱讀你的HTML文件並將其轉換爲UTF-8 String。 &負荷

webview.loadData(ur_html_str, "text/html", null); 

其中ur_html是這樣的:

String ur_html_str = "<html><body>youe body contents</body></html>";