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. DATABASE

hi...

i'm doing one project in android...i'm crateing one database...the have
three fields....the fields are id,title,url....i'm stored in url is String
format....but i want website URL pattern...at the same time i get the url
value in database...............please help me

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

2. Android Market filter problems

Hi guys.

I'm new to the group, so I don't know if anyone ever asked this.

Anyway, I recently created a game (Save Da Whale) using AndEngine and
made it available at the Android Market. The only filter my game has
is android.hardware.touchscreen.

It wasn't supposed to have any problems. But some customers have
reported that they cannot see the game using their device.

The devices that showed the problem are Xperia X10 (with custom rom
2.2) and Motorola Cliq XT (also with custom rom 2.1). They both have
touchscreen, so I think it wouldn't be the problem.

Anyone might know why are these devices being filtered?

PS.: They can download other apps, such as Adobe Flash, normally.

Thank you in advance,
Naftali

-- 

3. [WTA] Zyrex Onepad SP1110, NVidia Tegra Dual-Core ARM Cortex A9

4. Diasplay gtab tdk bisa landcape

5. [WTB] headset HTC EVO OEM

6. Cerita android

7. regarding onretainnonconfigurationinstance