Hi Chris,

What you want to to is define a new class that extends surface view(as
"Preview" in CameraPreview does) then include this in your XML layout
NOT a plain SurfaceView. Look at the lunar lander example, this is
done there.

http://code.google.com/android/samples/LunarLander/index.html

here's the bit you need to look at(from lunar_layout.xml)

<com.example.android.lunarlander.LunarView
 android:id="@+id/lunar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>

com.example.android.lunarlander.LunarView is a class that extends
SurfaceView

Cheers
Si

chrispix wrote:
> I originally wanted to implement a camera view on a tab (so if anyone
> can assist great!). But I have lowered my expectations to just
> rendering the preview onto a surfaceview that is defined as part of
> the layout.xml
>
> I have used : 
> http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html
>
> But I am stumped as to how to tie the code to a surfaceview defined in
> the layout.xml.
>
> My projects compile but then they fail at runtime.
>
> Any suggestions / help would be great. I have been stumped by this for
> a few days, purchased 3 books, and they hardly touch on the camera.
>
> Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to