Load two different views simultaneously in a screen

by And-Rider » Thu, 05 Mar 2009 21:52:12 GMT


Sponsored Links
 I want to create a single screen with two different views .And i want
to refresh one view without disturbing the second view.I mean i do not
want to refresh the entire screen and want to refresh only a part in a
screen....i am able to populate two layouts in one view but is there a
way to populate two views in one screen...?

       Screen
-------------------------------------------
                                         ------------->View 1
-------------------------------------------



                                     -------------------->View 2





---------------------------------------------


--~--~---------~--~----~------------~-------~--~----~



Load two different views simultaneously in a screen

by Kacza » Fri, 06 Mar 2009 05:19:33 GMT


 


Hi,
the first thing that comes to my mind is to create a LinearLayout, put
two views into it and refresh only one when needed.

class MyActivity extends Activity
{
    View topView;
    View bottomView;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

         LinearLayout layout = new LinearLayout(this);
         layout.setOrientation(LinearLayout.VERTICAL);

         this.topView = new MyTopView(this);
         this.bottomView = new MyBottomView(this);

        layout.addView(topView, new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT));
        layout.addView(bottomView, new LinearLayout.LayoutParams
(LinearLayout.LayoutParams.FILL_PARENT));
    }

    void refreshBottomView()
    {
       if (this.topView != null)
           this.topView.postInvalidate();
    }
}

(code not checked)


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to compile G1 apps code

Hi..........

I wanna to compile the apps code, has any one tried it earlier, if so
lemme know. How to compile the camera aur calender code.

-Sunil
--~--~---------~--~----~------------~-------~--~----~

2. Developing an app using a retail phone

Can anyone confirm for me that if I purchase a retail Android phone,
such as the HTC Dream (G1) that I can use it to develop applications?

I suspect that the answer is yes, but I want to confirm that a retail
phone can be used for developing apps before I shell out my money.

Thanks for any assistance.

Warwick

--~--~---------~--~----~------------~-------~--~----~

3. Rolodex View

4. Where to put xml file????

5. Invalidates the TabView

6. expandable list

7. URLConnection.getOutputStream() working fine in java main but not in android activity (Urgent plz)