android 获取配置文件 相对路径
生活随笔
收集整理的這篇文章主要介紹了
android 获取配置文件 相对路径
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
--src
--com.example.Demo1
--IndexActivity.class
????? --test.txt??
?
在IndexActivity.class 獲取test.txt中的文件內(nèi)容
?
InputStream inputStream = getClass().getResourceAsStream("test.txt");
?
//getClass().getResourceAsStream("path");??? 獲取當(dāng)前類的path,例如此例中就為 /com.example.Demo1/path
轉(zhuǎn)載于:https://www.cnblogs.com/lianghui66/p/3302934.html
總結(jié)
以上是生活随笔為你收集整理的android 获取配置文件 相对路径的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Quest Central for Da
- 下一篇: 在pl/sql中使用exp/imp工具实