Home > other >  Launching a transparent activity on HomeScreen
Launching a transparent activity on HomeScreen

Time:11-10

So there is an activity containing a webview. On launch/click on App Icon it should launch activity with webview as dialog on the HomeScreen of the device. Is there a way to achieve this?

CodePudding user response:

Yes, you can do it. Set the theme of MainActivity to Dialog, then you'll achieve it.

  <activity android:name=".MainActivity"
      android:theme="@style/Theme.AppCompat.Dialog">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>

It works fine for me. Hope it can help you~

If this answer helps you, please give me a like

  • Related