read file from assets

前端 未结 18 2237
终归单人心
终归单人心 2020-11-21 22:47
public class Utils {
    public static List getMessages() {
        //File file = new File(\"file:///android_asset/helloworld.txt\");
        AssetMan         


        
18条回答
  •  不知归路
    2020-11-21 23:45

    AssetManager assetManager = getAssets();
    InputStream inputStream = null;
    try {
        inputStream = assetManager.open("helloworld.txt");
    }
    catch (IOException e){
        Log.e("message: ",e.getMessage());
    }
    

提交回复
热议问题