After more research I found a ViewSwitcher fixes this issue.

Bobbie




On Feb 1, 9:40 am, Bobbie <[email protected]> wrote:
> I've seen some places where they say to create a separate activity for
> the second view.  However, it hardly seems necessary in my example
> because literally all I am doing at first is displaying a view, there
> are no other functions.
>
> On Feb 1, 9:05 am, Bobbie <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hey all!  I have a question.  I have a layout for a chat program that
> > has a variable height.
>
> > If I start with the chat screen layout (R.layout.chatView below - load
> > that layout first), the height will adjust with the virtual keyboard,
> > leaving the chat text in view and pushing the textbox and send
> > button's half way up the screen to show the soft keyboard like it
> > should.
>
> > HOWEVER, if I load a different layout BEFORE (R.layout.firstLayout
> > below) the chat screen layout, instead of doing what it does above, it
> > will push the chat text off the top of the screen and the textbox and
> > send button won't show unless I close the virtual keyboard
> > (switchViews is called by a button press).
>
> > --- Works Correctly Example ---
> > public void onCreate(Bundle savedInstanceState) {
> >      setContentView(R.layout.chatView);
>
> > }
>
> > --- DOES NOT Work Correctly Example ---
> > public void onCreate(Bundle savedInstanceState) {
> >      setContentView(R.layout.firstLayout);
>
> > }
>
> > public void switchViews() {
> >      setContentView(R.layout.chatView);
>
> > }
>
> > Am I missing something here?  Do I need to clear a view or something?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to