My use case is recording the activity of an overlay controller to preview a landscape camera. I followed the instructions from several tutorials to write a transparent topic.
So my res / values /style.xml look like this:
<resources> <style name="Theme" parent="android:Theme" /> <style name="Theme.Transparent"> <item name="android:windowBackground">@drawable/transparent_background</item> </style> <drawable name="transparent_background">#00000000</drawable> </resources>
Action snippet:
<activity android:name=".CameraPreview" android:label="Camera" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Controlls" android:label="Controlls" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent"> </activity>
When I start this activity from my root activity, the layout is drawn correctly, but the background remains black. I tried using @android:style/Theme.Translucent instead, but this theme inherits orientation from the calling activity (landscape), and that is not what I want.
Edit:
An application containing a camera preview is set to landscape mode, as it does not display the preview correctly in portrait orientation. (see old google bug report )
What I wanted to do was set up independent activity for the user interaction interface in front of the camera surface mount (for this action you need to install a "portrait" or even better a "sensor")
android android-layout
Uwe krass
source share