Click here to Skip to main content
15,608,936 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to android programming,can anyone tell me how to add captured image and recorded audio files dynamically into a horizontalscrollview->LINEARLAYOUT.

android:layout_marginBottom="8dp" >

<linearlayout> android:id="@+id/llHorizontalScroll"
android:orientation="horizontal" >

//Here i need to add dynamically created Buttons which should show on start up

I have three activities namely Image capture,Record Audio and scribble.
*> When i click record, it will record audio and add a button view dynamically to Linearlayout,
linear layout present inside horizontalscrollview where orientation is set to Horizontal for linear layout.
*> When i click capture it should capture an image and add a button view dynamically to linear layout and so on
*> and for scribble also same process.

I am able to capture,record the activities but couldn't able to add those to that linear layout dynamically.

Please help me out,a sample code will be really appreciated.
Thank you in Advance.

1 solution

If I am Understanding your problem well, then this code could be helpfull

LinearLayout linearLayout = (LinearLayout)inflater.inflate(R.layout.news_categories_item, null);

Button b1 = (Button)linearLayout.findViewById(;

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900