problems with swithcing from portrait to landscape


Last Updated:

  1. murali.lancer

    murali.lancer Member This Topic's Starter

    Joined:
    Sep 17, 2009
    Messages:
    18
    Likes Received:
    1
    Hi all,
    in my code ,in the same activity , i am changing the view ,using LayoutInflaters (adding another xml file with another view ),whenever a button click happens .

    My problem is whenever the mobile switching from portrait to landscape or landscape to portrait ,the activty is started from the onCreate method ,so the previous view is disappearing (like whenever i click the button one another view added ,that view is disappearing ).

    SO ,how to avoid this ,i.e.wherever the orientation changes from there only the activity should start.

    If any body knows pls give me reply ,it is giving me a lot of problems .

    Murali dhuli
    android developer
     

    Advertisement
  2. alostpacket

    alostpacket Over Macho Grande? VIP Member

    Joined:
    Nov 29, 2009
    Messages:
    7,978
    Likes Received:
    3,603
    Can you set your view to a class member and check if it already exists in onCreate, and if not create it and set it to the variable?

    I haven't tried this but it seems to make sense to me heh :)
     

Share This Page

Loading...