欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android 加載assets中的資源文件實(shí)例代碼

 更新時(shí)間:2017年01月24日 11:10:30   投稿:lqh  
這篇文章主要介紹了Android 加載assets中的資源文件實(shí)例代碼的相關(guān)資料,這里附有實(shí)例代碼,需要的朋友可以參考下

Android 加載assets資源

在android中,如何加載assets目錄下的文件夾呢?方法很簡(jiǎn)單,使用 AssetManager, 即

  AssetManager assetManager = getAssets();  

例子如下:

AssetManager assetManager = getAssets();   
  
     
    try {   
      String[] files = assetManager.list("Files");   
  
      for(int i=0; i<FILES.LENGTH;       
 
      { 
 
。。。。。。。 
       } 

 讀assets下的圖片


try {  
       
      InputStream ims = assetManager.open("android_logo_small.jpg");   
  
       Drawable d = Drawable.createFromStream(ims, null);   
  
      // set the drawable to imageview   
      imgAssets.setImageDrawable(d);   

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

您可能感興趣的文章:

相關(guān)文章

最新評(píng)論