I'm having a similar issue with 1.5..

setPreviewDisplay(...) works once. If I try to re-run the app then I
get the same exception or it simply stalls with no error messages.
When it does manage to run I get a bunch of errors (see below)...

Actually, I've noticed this is the case with the camera. It only works
once, then pretty much times out on the second try. As for the
camcorder, it doesn't work at all.
I couldn't find anything about this in the docs or forum so far.
Anybody know if this is a known issue? Or did we mess something up
when creating AVD?

Thanks!!

My development environment is Eclipse Ganymede on Kubuntu 9.04 (64bit)
>From logcat:
04-15 00:00:47.432: ERROR/vold(550): Error opening switch name path '/
sys/class/switch/test2' (No such file or directory)
04-15 00:00:47.432: ERROR/vold(550): Error bootstrapping switch '/sys/
class/switch/test2' (m)
04-15 00:00:47.432: ERROR/vold(550): Error opening switch name path '/
sys/class/switch/test' (No such file or directory)
04-15 00:00:47.432: ERROR/vold(550): Error bootstrapping switch '/sys/
class/switch/test' (m)
04-15 00:00:47.572: ERROR/flash_image(558): can't find recovery
partition
04-15 00:00:59.033: ERROR/MemoryHeapBase(585): error opening /dev/
pmem: No such file or directory
04-15 00:00:59.043: ERROR/SurfaceFlinger(585): Couldn't open /sys/
power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
04-15 00:00:59.083: ERROR/GLLogger(585): couldn't load <libhgl.so>
library (Cannot find library)
04-15 00:00:59.193: ERROR/GLLogger(585): couldn't load <libhgl.so>
library (Cannot find library)
04-15 00:01:01.583: ERROR/BatteryService(585): Could not open '/sys/
class/power_supply/usb/online'
04-15 00:01:01.583: ERROR/BatteryService(585): Could not open '/sys/
class/power_supply/battery/batt_vol'
04-15 00:01:01.583: ERROR/BatteryService(585): Could not open '/sys/
class/power_supply/battery/batt_temp'
04-15 00:01:01.883: ERROR/EventHub(585): could not get driver version
for /dev/input/mouse0, Not a typewriter
04-15 00:01:01.933: ERROR/System(585): Failure starting core service
04-15 00:01:01.933: ERROR/System(585): java.lang.SecurityException
04-15 00:01:01.933: ERROR/System(585):     at
android.os.BinderProxy.transact(Native Method)
04-15 00:01:01.933: ERROR/System(585):     at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
04-15 00:01:01.933: ERROR/System(585):     at
android.os.ServiceManager.addService(ServiceManager.java:72)
04-15 00:01:01.933: ERROR/System(585):     at
com.android.server.ServerThread.run(SystemServer.java:163)
04-15 00:01:01.943: ERROR/EventHub(585): could not get driver version
for /dev/input/mice, Not a typewriter
04-15 00:01:01.943: ERROR/AndroidRuntime(585): Crash logging skipped,
no checkin service
04-15 00:01:02.663: ERROR/LockPatternKeyguardView(585): Failed to bind
to GLS while checking for account
04-15 00:01:05.793: ERROR/ApplicationContext(585): Couldn't create
directory for SharedPreferences file shared_prefs/wallpaper-hints.xml
04-15 00:01:06.556: ERROR/ActivityThread(625): Failed to find provider
info for android.server.checkin
04-15 00:01:07.546: ERROR/ActivityThread(625): Failed to find provider
info for android.server.checkin
04-15 00:01:07.616: ERROR/ActivityThread(625): Failed to find provider
info for android.server.checkin
04-15 00:01:11.147: ERROR/AndroidRuntime(710): ERROR: thread attach
failed
04-15 00:01:23.247: ERROR/MediaPlayer(555): Unable to to create media
player
04-15 00:01:23.257: ERROR/CameraService(555): Failed to load
CameraService sounds.
04-15 00:01:23.257: ERROR/MediaPlayer(555): Unable to to create media
player
04-15 00:01:23.257: ERROR/CameraService(555): Failed to load
CameraService sounds.
04-15 00:01:23.277: ERROR/Camera(744): _getParameters: picture-
format=jpeg;picture-size=213x350;preview-format=yuv422sp;preview-frame-
rate=15;preview-size=176x144
04-15 00:01:23.297: ERROR/Camera(744): setParameters()




On Apr 14, 11:10 pm, Tom Gibara <m...@tomgibara.com> wrote:
> Camera.setPreviewDisplay() now throws an IOException. Is there a reason this
> had to be a checked exception (looking at the source code I can't an see an
> immediate one)? Or is it just an oversight that will be fixed before
> releasing the final SDK?
> The consequence is that one cannot have code that will compile for both 1.1
> and 1.5 without doing something ugly like adding a blanket try/catch, or a
> dummy throw like:
>
> try {
>   mCamera.setPreviewDisplay(holder);
>   if (false) throw new IOException();} catch (IOException e) {
>
>   /*handle exception*/
>
> }
>
> Tom.

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

Reply via email to