player = Manager.createPlayer("capture://image");\r
} catch (MediaException me) {\r
// if this fails, just continue with capture://video\r
+ } catch (NullPointerException npe) { // Thanks webblaz... for this improvement:\r
+ // The Nokia 2630 throws this if image/video capture is not supported\r
+ // We should still try to continue\r
} catch (Error e) {\r
// Ugly, but, it seems the Nokia N70 throws "java.lang.Error: 136" here\r
// We should still try to continue\r
}\r
}\r
if (player == null) {\r
- player = Manager.createPlayer("capture://video");\r
+ try {\r
+ player = Manager.createPlayer("capture://video");\r
+ } catch (NullPointerException npe) {\r
+ // The Nokia 2630 throws this if image/video capture is not supported\r
+ throw new MediaException("Image/video capture not supported on this phone");\r
+ }\r
}\r
return player;\r
}\r