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. Call URL

I am trying to call a URL for code.
This URL is supposed to move a camera connected on the same network

url = new URL("http://10.0.1.90/axis-cgi/com/ptz.cgi?
camera=1&move=home");
URLConnection cameraConnection = url.openConnection();
cameraConnection.connect();

I get no response when I run this code. Is this the right way to call
a URL from an Android phone ?

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

2. Chat Application

Is there an online tutorial for how to write a very mundane chat
application on the Android platform, over two or more phones? (doesn't
have to be anything special, just be able to send messages from one
phone to the other in real time)


Thanks
--~--~---------~--~----~------------~-------~--~----~

3. How to unsync Google Account in Android Phones

4. How to unsync Google Account in Android Phones

5. Selling apps through alternative markets

6. Skyscape

7. Data Retrieval in Android