0
我正在嘗試將背景圖像放在我的偏好活動上,並且我想動態地製作它。如何從我的PreferencesActivity類中獲取對我的contentView的引用?
這是我的代碼(在PrefrenceActivity類的OnCreate):
// Set the background image
Bitmap bmp = BitmapFactory.decodeResource(getResources(),R.drawable.spash_bk);
BitmapDrawable bitmapDrawable = new BitmapDrawable(bmp);
bitmapDrawable.setAlpha(100);
LinearLayout layout = (LinearLayout) *** here i need the layout ***
layout.setBackgroundDrawable(bitmapDrawable);
什麼,我缺少的是:誰可以進入佈局的參考,所以我可以執行的操作?
由於提前, 利奧爾