如何在android中动态添加图像
我有一个叫做公共活动的基类,因为我在每个活动中返回字符串如何在android中动态添加图像,android,uiimageview,Android,Uiimageview,我有一个叫做公共活动的基类,因为我在每个活动中返回字符串 txtHeader = (TextView)findViewById(R.id.txtHeaderText); txtHeader.setText(getScreenHeader()); 我将返回空字符串 protected String getScreenHeader(){ return ""; } 在另一项活动中,我将这样做 public final static String SCREE
txtHeader = (TextView)findViewById(R.id.txtHeaderText);
txtHeader.setText(getScreenHeader());
我将返回空字符串
protected String getScreenHeader(){
return "";
}
在另一项活动中,我将这样做
public final static String SCREEN_NAME = "Dashboard";
@Override
protected String getScreenHeader() {
return SCREEN_NAME;
}
如何为图像视图执行此操作
对不起我的英语
桑克斯,
Nikhil.您需要使用位图对象,例如:
Bitmap b = getBitmapImage();
ImageView img = (ImageView )findViewById(R.id.imgView);
img.setImageBitmap(b);
没有得到问题,那么你需要解释你需要什么。