How to add a layout into a layout in android?

Here's a snippet that creates a new layout (newL), adds an image to it, and then adds newL to a layout (layout) that was defined in the XML ViewGroup. LayoutParams lp_fullWidth = new ViewGroup. LayoutParams(lWidth, lHeight); ViewGroup.

LayoutParams lp_wrap = new ViewGroup. LayoutParams(LayoutParams. WRAP_CONTENT, lHeight); LinearLayout layout = (LinearLayout) findViewById(R.id.

ViewNowPlaying); LinearLayout newL = new LinearLayout(context); // create layout ImageView arrowRT = new ImageView(context); // create image arrowRT. SetImageResource(R.drawable. Arrowrt); // set source file newL.

AddView(arrowRT, lp_wrap); // add image to newL layout. AddView(newL,lp_fullWidth); // add newL to layout.

Thanks very much, that exactly I want to find – silverbullet. No1vn Dec 20 '10 at 2:15 Glad it helped. Please accept the answer (click the checkmark).

– TomG Dec 21 '10 at 2:32.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions