sometime Camera.open returns null or sometime it's working fine
<p>I am trying to get camera instance in on-create method using <code>Camera.open()</code> for showing camera preview.But sometime it returns null.How can i handle this problem.</p>

<p>I have given  permission in <code>manifest</code> file.</p>

<pre><code>&lt;uses-permission android:name="android.permission.CAMERA" /&gt;
&lt;uses-feature android:name="android.hardware.camera" /&gt;
</code></pre>
