Android中读取assets文件夹中的子文件夹内容

文件结构如下:assets/info/info

       AssetManager am = this.getResources().getAssets();
            InputStream input = null;
            try {
                input = am.open("info/info");
                int len = input.available();
                byte[] buffer = new byte[len];
                input.read(buffer);
                input.close();
                String str = EncodingUtils.getString(buffer, "UTF-8");
                Toast.makeText(this, str, Toast.LENGTH_LONG).show();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

 

 

posted @ 2014-02-21 14:02  yshy  阅读(1605)  评论(0编辑  收藏  举报