title: android camera function getcameraIdlist() function does not return anything
body: <ol>
  <li>The code produces an <code>IllegalArguementException</code>.</li>
  <li>The list does not seem to populate even though all <code>permissions</code> are given in the <code>manifest</code>.</li>
  <li><p>The <em>application crashes</em> as soon as the <code>Activity</code> is opened.</p>
  
  <p>public class photo extends Activity {
              private Handler mhandler;
              public CameraDevice cam;
              private CameraDevice.StateCallback mcallback;</p>
  
  <pre><code>public void setCallback(CameraDevice.StateCallback callback) {
      this.mcallback = callback;
  }
  
  public void setHandler(Handler handler) {
      this.mhandler = handler;
  }
  
  
  int count=0;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_photo);
  
      String[] list=new String[10];
      CameraManager camera = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
  
      setCallback(mcallback);
      setHandler(mhandler);
       ListView cami = (ListView) findViewById(R.id.lv);
  
      ArrayAdapter adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.main_photo, R.id.textView2, list);
  
      cami.setAdapter(adapter);
  
      try
  
      {
          list = camera.getCameraIdList();
          count++;
  
      } catch (CameraAccessException e)
  
      {
          e.printStackTrace();
      }
  
  
  
  
         try
  
          {
              camera.openCamera(list[0], mcallback, mhandler);
              mcallback.onOpened(cam);
  
  
          } catch (CameraAccessException e)
  
          {
              e.printStackTrace();
  
              Log.d("Photo", "Error in opening camera");
          } catch (IllegalArgumentException a)
  
          {
              Log.d("Callback", "Callback Problem");
          }
  
      }
  </code></pre></li>
  </ol>