android读取assets中的配置文件英文没问题,但是中文会出现乱码的问题,前提配置文件已经是utf-8的格式了
出现问题的代码:

 @Override    public void start() {        try {            Properties properties = new Properties();            InputStream inputStream = context.getAssets().open("config.properties");、            properties.load(inputStream);            myPackage = properties.getProperty("mypackage");            myName = properties.getProperty("myname");            myGitHub = properties.getProperty("mygithub");            myCSDN = properties.getProperty("mycsdn");        } catch (IOException e) {            e.printStackTrace();        }    }

经过修改后就没有以上的问题了,不要让properties直接去load流文件就可以了

@Override    public void start() {        try {            Properties properties = new Properties();            InputStream inputStream = context.getAssets().open("config.properties");            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));            properties.load(bufferedReader);            myPackage = properties.getProperty("mypackage");            myName = properties.getProperty("myname");            myGitHub = properties.getProperty("mygithub");            myCSDN = properties.getProperty("mycsdn");        } catch (IOException e) {            e.printStackTrace();        }    }

更多相关文章

  1. Android 中文 API(123) —— AbsListView
  2. 关于android UDP 客户端与delphi UDP服务端通讯中文乱码问题
  3. Android中文API(95)——SimpleExpandableListAdapter
  4. Android中设置中文粗体的方法
  5. android 中文 API (41) —— RatingBar.OnRatingBarChangeListen
  6. android api 中文 (75)—— AdapterView.OnItemClickListener
  7. 去除listBView的抖动,判断textView中文本长度是不是超过预定值
  8. Android中文API(142) —— Gravity

随机推荐

  1. windows 系统Android模拟器联网设置
  2. Android 高德地图在清除Marker的时候会把
  3. Android对话框AlertDialog-android学习之
  4. Android:dimen尺寸资源文件的使用
  5. Android 启动环境配置
  6. android EditText 设置输入的文字的格式
  7. Android下的重力感应应用
  8. Android(安卓)JNI 面面观 1
  9. Android开发艺术探索学习笔记(十)
  10. Android Scroller类介绍