Skip to content
Advertisement

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?

Advertisement

Answer

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~

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement