How to get the path to the Android assets folder in the application package

前端 未结 3 1514
渐次进展
渐次进展 2020-12-31 00:37

I have a whole folder structure that I want to copy from my assets folder. However, the mContext.getAssets().open() seems to only want a filename so that it can return an

3条回答
  •  灰色年华
    2020-12-31 01:30

    AssetManager am = con.getAssets();//u have get assets path from this code
    InputStream inputStream = null;         
    inputStream = am.open("file.xml");
    

    or

    String file_name="ur.xml"    
    inputStream = am.open("foldername/"+ur);
    

提交回复
热议问题