{"id":3667,"date":"2014-03-29T07:45:55","date_gmt":"2014-03-29T07:45:55","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/fail-to-connect-camera-service-in-front-camera-collection-of-common-programming-errors\/"},"modified":"2014-03-29T07:45:55","modified_gmt":"2014-03-29T07:45:55","slug":"fail-to-connect-camera-service-in-front-camera-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/fail-to-connect-camera-service-in-front-camera-collection-of-common-programming-errors\/","title":{"rendered":"Fail to connect camera service in front camera?-Collection of common programming errors"},"content":{"rendered":"<p>i am using Camera Api in that when ever i lanch app it will show back camera it works fine but when i click front camera button it will get Runtime excetion Fail to connect camera service<\/p>\n<pre><code>in  camera = Camera.open(cameraID);\n\nin front camera button code :\n\nif (cameraID == Camera.CameraInfo.CAMERA_FACING_BACK)\n            {\n                Toast.makeText(getApplicationContext(), \"Front Camera\", Toast.LENGTH_LONG).show();\n\n                cameraID = Camera.CameraInfo.CAMERA_FACING_FRONT;\n\n            }\n            else if (cameraID == Camera.CameraInfo.CAMERA_FACING_FRONT)\n\n            {\n                Toast.makeText(getApplicationContext(), \"Back Camera\", Toast.LENGTH_LONG).show();\n\n                cameraID = Camera.CameraInfo.CAMERA_FACING_BACK;\n\n            }\n\n            Intent intent = getIntent();\n\n            finish();\n\n            startActivity(intent);\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>i am using Camera Api in that when ever i lanch app it will show back camera it works fine but when i click front camera button it will get Runtime excetion Fail to connect camera service in camera = Camera.open(cameraID); in front camera button code : if (cameraID == Camera.CameraInfo.CAMERA_FACING_BACK) { Toast.makeText(getApplicationContext(), &#8220;Front Camera&#8221;, [&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-3667","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3667","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=3667"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3667\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}