ITeye博客

android中读取assets中的文件

dengzh · 2011-06-28 09:42 · android · 移动开发 · Android · 读取Assets · 文件 · Markdown

   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);   

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。