I am working on a Android camera apps with target level 2.1
however I find difficult while I enter the full screen mode,
I want to show button during the preview, but it actually hidden, so any one know how to do with it??
this is the code find on this website and have a litte bit modify
http://marakana.com/forums/android/examples/39.html
Preview preview;
Button buttonClick;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cameralayout);
preview = new Preview(this);
((FrameLayout) findViewById(R.id.preview)).addView(preview);
setContentView(R.layout.cameralayout);
buttonClick = (Button) findViewById(R.id.buttonClick);
buttonClick.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);
}
});
Log.d(TAG, "onCreate'd");
}
this is the xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/preview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button
android:id="@+id/buttonClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:text="Click" />
</FrameLayout>
and the manifest has set the theme to make it in full screen
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
So how to make my button visible with the present of full screen preview
Thank you very much~
I believe you are missing the
SurfaceViewview.Inside
FrameLayoutlayout put theSurfaceViewwhich will hold the camera preview, and your button below.