can anybody help me with how to capture image by front camera in background without using any button in android???
Like in the screenshot below... if i press this "yes" radio button then the image should be captured and saved to another class..
I have tried to do it but i could not do it as i want to frown emoticon
the code which i wrote take picture by user interference i.e by clicking a button.
Here is the code of java class:
public static int cameraID = 0;
public static boolean isBlack = true;
public static ImageView image;
@override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.capturedimage);
image = (ImageView) findViewById(R.id.imgView);
}
public void onFrontClick(View v) {
RadioButton rdbBlack = (RadioButton) findViewById(R.id.rdb_black);
if (rdbBlack.isChecked()) {
isBlack = true;
} else {
isBlack = false;
}
cameraID = 1;
Intent i = new Intent(Picture.this, ViewCam.class);
startActivityForResult(i, 999);
}
and xml screen shot for taking photo from front cam is below..:crying::(
Like in the screenshot below... if i press this "yes" radio button then the image should be captured and saved to another class..
I have tried to do it but i could not do it as i want to frown emoticon
the code which i wrote take picture by user interference i.e by clicking a button.
Here is the code of java class:
public static int cameraID = 0;
public static boolean isBlack = true;
public static ImageView image;
@override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.capturedimage);
image = (ImageView) findViewById(R.id.imgView);
}
public void onFrontClick(View v) {
RadioButton rdbBlack = (RadioButton) findViewById(R.id.rdb_black);
if (rdbBlack.isChecked()) {
isBlack = true;
} else {
isBlack = false;
}
cameraID = 1;
Intent i = new Intent(Picture.this, ViewCam.class);
startActivityForResult(i, 999);
}
and xml screen shot for taking photo from front cam is below..:crying::(
Aucun commentaire:
Enregistrer un commentaire