assets 读取资料

assets 读取文件读取文字文件(txt,xml)InputStream is getAssets().open(about.txt)int size is.av

assets 读取文件
读取文字文件(txt,xml)

  InputStream is = getAssets().open("about.txt");                        int size = is.available();            byte[] buffer = new byte[size];            is.read(buffer);            is.close();            String text = new String(buffer);            TextView tv = (TextView)findViewById(R.id.text);            tv.setText(text);


读取图片资源
 Bitmap bgImg = getImageFromAssetFile("background.png")