I’ve was studying on some source code from this link
http://android-er.blogspot.com/2010/12/add-overlay-on-camera-preview.html
what should i do here if i want to add another button, i’ve added button in xml, but they are not working, their source code is:
LinearLayout layoutbg = (LinearLayout) findViewById(R.id.background);
layoutbg.setOnClickListener(new LinearLayout.OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case (R.id.previous_btn):
//some source
showImage();
break;
case (R.id.next_btn):
//some source showImage();
break;
}
}
private void showImage() {
// TODO Auto-generated method stub
Toast.makeText(AndroidCamera.this, " User don't ", Toast.LENGTH_SHORT);
}
});
}
make your Activity implement
View.OnClickListenerAfter that in your
onCreate()method do:In the OnClick() Method that you have to override after implementing
View.OnClickListenerdo the following: