`

android中读取assets中的文件

阅读更多
   private Bitmap getImageFromAssetFile(String fileName){  
    Bitmap image = null;  
    try{  
        AssetManager am = context.getAssets();  
        InputStream is = am.open(fileName);  
        image = BitmapFactory.decodeStream(is);  
        is.close();  
    }catch(Exception e){  
          
    }  
    return image;  
}  

 

 InputStream in = getResources().getAssets().open(fileName);   
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics