Tuesday, January 8, 2013

[android-developers] Child Canvas Activity Width Reduction

Greetings,

When called via a parent activity the width of my canvas screen is reduced/limited to about half screen. The same code when run as a stand alone app fills the full width of the screen which is what I wish to have also happen when it is merged into the overall package and called from my main activity.

The main parent activity GUI consists of multiple buttons and text views within a relative layout. It occupies approximately half the landscape width and two thirds the height.

I wish to be able to call a full screen canvas that will overlay the paused main activity GUI. I have made a separate app that uses an onDraw(Canvas) class called DrawView that does provide the full screen canvas that I want when run as a stand alone app. The Canvas class is called from an activity with the code that is shown below. The problem I have is that when I merge this code into my main package and call it from the main activity the width of the canvas is reduced to about half width. I don't know what is causing the width reduction and have tried many options to no avail. Does a main activity have control over the display width of a child activity? How can I override this width reduction from happening?

Thanks in advance for any help!

    @Override      public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          // Set full screen view          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                 WindowManager.LayoutParams.FLAG_FULLSCREEN);            drawView = new DrawView(this);          setContentView(drawView);          drawView.requestFocus();          drawView.setBackgroundColor(0xFFFFFFFF);                  }

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

No comments:

Post a Comment