On 5 Mar, 14:50, And-Rider <[email protected]> wrote:
> I want to create a single screen with two different views .And i want
> to refresh one view without disturbing the second view.

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)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to