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();

            }

 

 

你可能感兴趣的:(android)