{"id":3365,"date":"2014-03-23T11:23:57","date_gmt":"2014-03-23T11:23:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/23\/samsung-galaxy-ace-surfaceview-camera-error-collection-of-common-programming-errors\/"},"modified":"2014-03-23T11:23:57","modified_gmt":"2014-03-23T11:23:57","slug":"samsung-galaxy-ace-surfaceview-camera-error-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/23\/samsung-galaxy-ace-surfaceview-camera-error-collection-of-common-programming-errors\/","title":{"rendered":"samsung galaxy ace surfaceview\/ camera error-Collection of common programming errors"},"content":{"rendered":"<p>I am writting an app that is supposed to be compatible with the samsung galaxy ace. I have the following code:<\/p>\n<pre><code>mPreview = (SurfaceView)findViewById(R.id.preview);\nmPreview.getHolder().addCallback(this);\nmPreview.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\nmCamera.setDisplayOrientation(0);           \nmCamera = Camera.open();\n<\/code><\/pre>\n<p>It crashes at<\/p>\n<pre><code>mCamera.setDisplayOrientation(0);\n<\/code><\/pre>\n<p>And gives the following error:<\/p>\n<pre><code>\/AndroidRuntime(18011): Caused by: java.lang.NullPointerException\n<\/code><\/pre>\n<p>I have tried to set the value to 90, 180, 270 and 360, but nothing seems to solve this issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am writting an app that is supposed to be compatible with the samsung galaxy ace. I have the following code: mPreview = (SurfaceView)findViewById(R.id.preview); mPreview.getHolder().addCallback(this); mPreview.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); mCamera.setDisplayOrientation(0); mCamera = Camera.open(); It crashes at mCamera.setDisplayOrientation(0); And gives the following error: \/AndroidRuntime(18011): Caused by: java.lang.NullPointerException I have tried to set the value to 90, 180, 270 and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3365","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3365"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3365\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}