i used many codes and all work on 4.0 but jelly bean Os did not support any code 

```
 try
                     {
        Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

        startActivityForResult(cameraIntent, 1);        
                     }
                  catch(ActivityNotFoundException anfe){
                    //display an error message
    //                  String errorMessage = "Whoops - your device doesn't support capturing images!";
                     Toast toast= Toast.makeText(getApplicationContext(), "Whoops - your device doesn't support capturing images!", Toast.LENGTH_SHORT);  
                     toast.setGravity(Gravity.CENTER, 0, 0);
                     toast.show();

                }

```