1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| public void onCreate(Bundle savedInstanceState)
{
Toast.makeText(getApplicationContext(), "onCreate", Toast.LENGTH_SHORT).show();
..........
btn_camera = (ImageView)findViewById(R.id.camera);
btn_camera.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View arg0)
{ Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 0);}});
}
//___RETURN CAMERA
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
Toast.makeText(getApplicationContext(), "onActivityResult", Toast.LENGTH_SHORT).show();
if (resultCode == RESULT_OK)
{
traitements.toastNow("Capture OK ", context);
.............................
}else if (resultCode == RESULT_CANCELED) traitements.toastNow("camera canceled", context);
}
@Override
protected void onDestroy() {
super.onDestroy();
traitements.toastNow("onDestroy", context);
} |