Honeycomb full screen game issues

by Leigh McRae » Thu, 19 May 2011 06:26:57 GMT

Sponsored Links

My game isn't handling Honeycomb correctly it seems.  I get the
DisplayMetrics in Activity.onCreate and setup my game expecting to be
able to use the full screen.  So I'm guessing that I need to go
through the process of creating a View and getting it's size in order
for it to work on Honeycomb.

The problem is, from what I'm seeing, is that the view isn't created
and fully measured until sometime after Activity.onResume.  The first
shot I get at it with valid dimensions is in my
SurfaceHolder.Callback.  Right now my game is setup to pretty much
have a one to one mapping of the Android Activity lifecycle and I need
my screen size pretty early on.  Is there anyway around this?  All I
can think to do is not create my app until the first time the surface
is created.


Re: Honeycomb full screen game issues

by Dianne Hackborn » Thu, 19 May 2011 07:51:17 GMT

 Yes the actual dimensions available to your app are not known until
View.onSizeCreated() or SurfaceHolder.Callback.surfaceCreated().

On Wed, May 18, 2011 at 3:26 PM, Leigh McRae <leigh.mc...@lonedwarfgames.com

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. Injecting Data into Android's Location Manager


I was wondering if it is possible if our customized hardware device
does not have a GPS antenna, but we have location data coming from
another source, if we can inject this data into the Android Location
Manager so that other APK's (programs) that use the passive location
manager to get GPS coordinates can get our injected data instead.



2. Adding an button to a custom view

Dear Developers,

My name is Kapil and I am trying to write a custom view which inherits
View class and everything is drawn in the onDraw function. There is no
xml for the view. The custom view class is instantiated and set in the
function setContentView of an activity.

I wish to add the some buttons to the custom view class
programatically; I have searched over forums and internet; but could
not find proper solution.

Is it possible to do? Can we add a button [or any other view item]
dynamically to a custom view without using XML?

Also Is mixing of custom drawing and XML based view content possible
and if yes how to achieve it?

Please advise.



3. Google IO 2011

4. EditText causes app to crash

5. Is it true, Paid Aandroid apps from indian origin can not be published?

6. How to reverse camera view?

7. add overlay at my current location