我一直在研究这个链接的一些源代码 http://android-er.blogspot.com/2010/12/add-overlay-on-camera-preview.html
如果我想添加另一个按钮,我应该在这里做什么,我已经在 xml 中添加了按钮,但是它们不起作用,它们的源代码是:
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);
}
});
}