简体   繁体   中英

Launching a transparent activity on HomeScreen

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?

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💕. It's important for me, thank you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM