Error trying to use XML Layout and extended GLSurfaceView

by Kostya Vasilyev » Thu, 06 May 2010 04:57:49 GMT

Sponsored Links
 ust a wild guess. Could be wrong.

Perhaps when Android views are instantiated from XML, there is a parser
involved, and at construction time it is positioned at that view's XML tags.

Then it's time to instantiate the view's children, and they are in turn
passed "bridge" XML parsers that appear to represent complete XML file, but
in fact are made to look at just the portion of the original XML file that
corresponds to the children.

Somewhere in there is support for <merge> tag, and other niceties that
Android provides in its XML layout support.

Perhaps you could look at Android source, and investigate constructors of
various Views (esp. ViewGroup and subclasses) that deal with loading from
XML, and see what they do with their arguments before calling super(....).

-- Kostya

2010/5/6 Jeremiah Sellars <>


Other Threads

1. Bitmap GetPixel() & GetPixels()

Hi all,

I am absolutely brand new to android programming, but I have a fair
amount of experience with 3D programming and games programming in
general and im trying to build a simple game in android.

The problem I am having is rather odd, but i'm hoping is a problem
with me rather than android. I have been using GetPixel and GetPixels
on a bitmap I have loaded through the bitmap factory. However when
cycling through the pixel data I seem to get incorrect results.

For example I made a simple 2x1 pixel image with one white pixel and
one red pixel just to ensure that colours where being read correctly,
but it seems that this is not the case. For starters the image was
read as a 1x1 pixel image with the colour values, presumably
interpolated between red and white...

This is a real problem for me as I need the exact value at each pixel.
Is there a way to get around this or is it just not viable?

Here is how the image is loaded:

Bitmap wImage = BitmapFactory.decodeResource(Globals.gResources,

Thanks in advance guys.


2. Images in app

I see three folders drawable-hdpi,mdpi,ldpi.

Do I need to duplicate my images in all of these folders?Or can I just
place my images in one or the other and it does not matter?



3. Camera orientation problem

4. How to reduce heap size to get space for BitmapFactory.decodeFile()

5. FileObserver issue..

6. Porting android to motoming

7. Can i put a googlemap in the middle section of my user interface???