지금은 /pkg/pages 파일을 넣은/assets/폴더가 있습니다.안드로이드에서 사진 설치
최근 개발자가 나를 위해 새로운 자산을했다 - 그들은 (예를 들어 사용) 형식으로 온 :이 (예 /res/drawable-mdpi/
를 등) /res/drawable/
폴더에 갈 필요가 있는가
/mdpi/example_asset.png
/xhdpi/[email protected]
을 ? my/asset/폴더에있는 파일 대신이 파일을 사용하려면 코드를 완전히 변경해야합니까?
는 일반적으로 I (예를 들어/assets/example_asset.png
같은 경우)이 자산 폴더에서 비트 맵을 얻기 위해 해왔 :
public static Bitmap getBitmapFromAsset(Context context, String fileName) {
AssetManager assetManager = context.getAssets();
InputStream istr;
Bitmap bitmap = null;
try {
istr = assetManager.open(fileName + ASSET_FILE_EXTENSION);
bitmap = BitmapFactory.decodeStream(istr);
} catch (IOException e) {
Log.w(LOG_TAG, "Could not get bitmap for asset image " + fileName + ": " + e);
}
return bitmap;
}
무엇 모두 내가 변경해야
, 여기?
왜 downvote? 힘든 군중! – user7368066