I have a situation where I need to set a background on a LinearLayout programatically.
In my layout, I am setting my background using `android:background=\"?android:att
Please try the following code.
LinearLayout layout=(LinearLayout) findViewById(R.id.layoutImage); layout.setBackgroundResource(R.drawable.bg);