2012-05-12 131 views
0

我有基本類被稱爲常見活動,因爲我在每個activity.By使用下面的代碼返回字符串。如何動態添加圖像android

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; 
    } 

我該怎麼做這個對於圖像查看。

對不起,我的英文。

Thansks, Nikhil。

+0

沒有得到我不需要這樣的 –

回答

1

您需要使用位圖對象,如這樣的:

Bitmap b = getBitmapImage(); 
ImageView img = (ImageView)findViewById(R.id.imgView); 
img.setImageBitmap(b); 
+0

然後,你需要解釋一下你所需要的。 –

+0

問題 –