How to use setContentView more than once

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

How to use setContentView more than once

Postby HennaMullaji » Thu Feb 11, 2010 5:38 pm

Hello I am new to android development and have started experimenting with it from the last two mnths.
I am writing a code where i need to display a spinner as well as a piechart on the same page(i.e same screen one below the other).
As we can use setContentView only once in onCreate method...i was wondering as to how will I be able to display two things at a time .
Any help with code snippet will be useful.

Thanks in advance,
H
HennaMullaji
Freshman
Freshman
 
Posts: 5
Joined: Thu Feb 11, 2010 4:57 am

Top

Postby Strategy » Sat Feb 20, 2010 11:14 pm

Just create a layout with both a spinner and piechart.

That aside, you can easily use setContentView multiple times (e.g., have a button change the setContentView). Just remember that changing views nulls references to buttons, etc. on the destroyed layout.
Strategy
Freshman
Freshman
 
Posts: 8
Joined: Thu Jun 18, 2009 11:00 pm

Top

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests