I found a solution:
1) Create an XML theme in res/values/ :
<?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="Theme.Transparent" parent="android:Theme"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:backgroundDimEnabled">false</item> </style> </resources>
2) Style of rounded corners drawable/rounded_corners.xml :
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#FFFFFFFF" /> <corners android:radius="10dp" /> </shape>
3) XML action:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/qrCodeContainer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_horizontal" android:background="@drawable/rounder_corners" android:orientation="vertical" android:padding="15dp" android:layout_margin="6dp" > </RelativeLayout> </RelativeLayout>
4) Describe Activity in the manifest of the XML project:
<activity android:name=".view.ViewCodeActivity" android:label="@string/app_name" android:theme="@style/Theme.Transparent"> </activity>
source share