This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Android and the fly likes odd framelayout/surfaceview problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "odd framelayout/surfaceview problem" Watch "odd framelayout/surfaceview problem" New topic
Author

odd framelayout/surfaceview problem

Ken Truitt
Ranch Hand

Joined: Aug 23, 2007
Posts: 124
[actually i'm going to have another go at this myself--sometimes
helps to write it out]


SCJP 88% | SCWCD 84%
Ken Truitt
Ranch Hand

Joined: Aug 23, 2007
Posts: 124
Ok, I made some changes, checked on another phone in a store, and still the same problem, which is
described below.

----------------

I have a framelayout that has, so far as we're concerned with here, a surfaceview added to it, which
would occupy the entire screen, and then a linearlayout, which would lie over that screen. It has always
worked in the emulators, but when I tried it on some 2.1 phones in a store, the imageviews in the
linearlayout (vertical) didn't show. I know they were there somewhere because they behaved correctly
when I clicked where they should be. I think my clicks would click through the surfaceview. So I'm
guessing somehow, despite being defined in the correct order in the xml, the linearlayout is getting in
the framelayout AFTER the surfaceview, so it's obscurred. This happened 8 out of 10 times when I
was in the store. 2 times it worked just right.

The imageviews are added to the linearlayout programatically shortly after oncreate(). any ideas on
how this could happen? If you have a 2.1 phone and don't mind, it's BrainBuilder on the market. Return
it after you're done for no charge, as you know.

In the xml below, the relevant linearlayout is id=pegLayout. But first is the method that is called (now) at
the end of oncreate() in my one activity to populate the linearlayout with actual imageviews (subclassed to
PegView):


And now the xml...

>
Ken Truitt
Ranch Hand

Joined: Aug 23, 2007
Posts: 124
Hey folks it would be great if someone--anyone--could download my app from the market ("BrainBuilder") onto
their 2.1 device and tell me if they're getting this problem that I related in my previous post.

It would get GREATER if someone might suggest some ideas to help me track down the issue. Given that
the imageviews display sometimes, and sometimes they don't, i can only imagine some kind of thread-like
issue. But I haven't spawned any threads.

Does it make sense to imagine that sometimes the linearlayout loads before the surfaceview (or other obscuring
view) and other times it doesn't?

AS I DO NOT HAVE A 2.1 DEVICE, I CANNOT TEST IT MYSELF (and yes, it works fine on the 2.1 emulator)

Thanks

ps if you download it and don't want to keep it, remember to return it within FIFTEEN minutes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: odd framelayout/surfaceview problem
 
Similar Threads
To all cricket lovers out there
Need urgent advice
Games people play
what's ur favorite game??
Including Code From Another Source on a JSP