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. mohon bantuan, pusing soal DREAM

mohon bantuan lg pusing berat soalnya
ceritanya :
1minggu yg lalu beli HTC dream n mau gw root spy bisa ganti rom :D
tapi pusing, sblm gw apa2 in dreamnya update sendiri ke firmware 1.5
nah trus gw ikutin cara root dari
http://wiki.cyanogenmod.com/index.php/Main_Page#How_do_I_upgrade_to_the_latest_CyanogenMod.3F

 dan dari sini
http://www.mreunion.net/android/wiki/index.php/HTC_Dream

tapi tetep g pernah berhasil, lalu gw coba donlot firmware 1.6 dr
HTCnya gw update sukses tapi tetep g bisa ganti room yg laen??!?!?!

pertanyaannya :
1. ada yg bisa bantuin g cara root yg gampang dr firm 1.6???
2. ato ada theme yg keren n gimana cara installnya yg gampangya.

tq master2 smua. tolong dibantuin
--~--~---------~--~----~------------~-------~--~----~
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

2. Is there an explorer for all contentProviders?

Hi.

I want to search all the content providers. Is there a UI for doing
this?

-- 

3. what is envsetup.sh

4. internal compiler error: Segmentation fault (Eclair + 4.3.1 toolchain)

5. Accents in strings

6. Call Webservice From Android

7. Mod: Info Gathering