Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/214.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android中动态添加图像_Android_Uiimageview - Fatal编程技术网

如何在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);

没有得到问题,那么你需要解释你需要什么。