Vote count:
0
Hi guys I am trying to take a snapshot from my app which uses the existing camera app in the device. I have followed the steps provided on Android developers site.
public boolean onMenuItemSelected(int featureId, MenuItem item) {
// TODO Auto-generated method stub
switch(item.getItemId()){
case R.id.pic_take:
i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, cameraData);
return true;
}
return super.onMenuItemSelected(featureId, item);
}
followed by this:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == cameraData && resultCode == RESULT_OK){
Bundle extras = data.getExtras();
bmp = (Bitmap) extras.get("data");
cameraView.setImageBitmap(bmp);
}
}
I have also made sure that my emulator has the front and back camera enabled.
Please do no close this question. The problem is when I select the option the camera does not open and there is no errors as well in the activity log. Neither does the application crash: When I click the option, the only message I get in activity log is :
04-01 17:44:16.665: I/Choreographer(1227): Skipped 48 frames! The application may be doing too much work on its main thread.
Kindly help me solve this problem.
asked 36 secs ago
Aucun commentaire:
Enregistrer un commentaire