How to read local xml file is resource folder as a input stream in android?

前端 未结 2 428
北恋
北恋 2021-01-01 06:03

I am trying to get input stream from something like this.

InputSource myInputSource = new InputSource(activity.getResources().openRawResource(com.MYCLass.R.x         


        
2条回答
  •  有刺的猬
    2021-01-01 06:52

    You can read the file by the following code :

    InputStream object = this.getResources()
            .openRawResource(R.rawFolderName.fileName);
    

提交回复
热议问题