银行卡的种类非常多,名字和图片怎么对应是非常困难啊,我使用的Assets
public static final Drawable getImageFromAssetsFile(Context context, String fileName) {
BitmapDrawable bd = null;
try {
InputStream is = context.getAssets().open(String.format("%s.png",
fileName));
bd = new BitmapDrawable(context.getApplicationContext().getResources(), is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return bd;
}