Question about Button and SurfaceView

by Karthik Ravi Shankar » Fri, 23 Apr 2010 16:23:56 GMT

Sponsored Links

I am trying to use SurfaceView for an app. But I need to add buttons the
canvas as well. Not able to gather much from Android.developer site. Can
anybody post if they have done it or have some ideas ?

Karthik R
Graduate Student
Computer Science Department


Question about Button and SurfaceView

by Mark Murphy » Fri, 23 Apr 2010 19:33:21 GMT


Step #1: Define a RelativeLayout.

Step #2: Put the SurfaceView as a child of the RelativeLayout.

Step #3: Put the Button as a *later* child of the RelativeLayout.

This will cause the Button to appear to "float" on the SurfaceView. See
this project for an example: 

Mark Murphy (a Commons Guy)  | 

Android App Developer Books: 


Sponsored Links

Other Threads

1. [WTShare] Turut berduka buat X10 users

Bener2 nih SE.. kyknya males banget devs-nya..
Padahal pas presentasi di SenCy kesannya bakal di-support terus.. -____-"

 *Sony Ericsson: no OS updates for Xperia X10 beyond Android 2.1, it's
better than 2.2 anyway *
 By Vlad Savov <>
<> posted Jan 6th 2011

The farce that has been Sony Ericsson's bungled,
and deservedly maligned Android upgrade
story<,android>for the Xperia
coming to a fittingly silly end. Questioned by
*Android Community* on the possibility of a Froyo (Android 2.2) upgrade for
its initial set of Android handsets, the SE team has just come out and
admitted that there'll be no future OS upgrades, at least in terms of
Android iterations. The X10, X10 Mini and X10 Mini Pro are not being
abandoned, not at all, but the only software enhancements you can look
forward to will come directly from Sony Ericsson. The company hardly sees
that as a bad thing, however, judging by a recent tweet announcing its
belief that an SE-customized Eclair tastes better than Google's untouched
We'd protest, but what's the use?


2. [WTS] jual kartu 3unlimited bawaan journey

as subject saya mau coba jual kartu 3unlimited bawaan journey, sayang gak
kepake, udah seminggu diaktifin,

saat ini kartu udah saya buka.

yang minat bisa japri ke

terima kasih


3. Android harga gila/spesial hanya 3 hari buktikan!!!

4. Android NDK

5. Next Xperia-Droid : ARC

6. [Wts] htc desire HD, motorola defy, Nexus One 2nd, Samsung Nexus S

7. Downloading file and asynctask opinion needed