To open the usual activites in the form of a dialogue, I use the style

<style name="myDialogNoTitleBar" parent="@style/Theme.AppCompat.Light.Dialog.Alert"> <item name="windowNoTitle">true</item> </style> 

and just add in the manifest to the desired activation

 android:theme="@style/myDialogNoTitleBar" 

but for authorization through vk sdk function is used

 VKSdk.login(this, scope); 

which itself opens the necessary activations and does everything that is necessary.

  • The question is not clear. Do you want to start the activation with the login from the dialogue? Type opened a dialogue, clicked the button and opened the activation with a login? And you do not know what to pass instead of this ? - Yuriy SPb
  • @YuriSPb in no case. I want to open a window with the login form in the dialogue, not a new activation. - user3239600

1 answer 1

In the manifest, when connecting VKSDK, it is necessary to register the activation, where, in particular, the style

In source, it looks like this:

 <style name="VK.Transparent" parent="@style/Theme.AppCompat.Light.Dialog.Alert"> <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> </style> 

Accordingly, you can try to define your style with the same attributes, but inherit it from the dialog style and assign this VKontakte activation in the manifest.

In styles:

 <style name="MY.VK.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> </style> 

In the manifest:

 <activity android:name="com.vk.sdk.VKServiceActivity" android:label="ServiceActivity" android:theme="@style/MY.VK.Transparent" /> 
  • Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute activity#com.vk.sdk.VKServiceActivity@theme value=(@style/MY.VK.Transparent) from AndroidManifest.xml:44:13-53 is also present at [com.vk:androidsdk:1.6.7] AndroidManifest.xml:15:13-50 value=(@style/VK.Transparent). Suggestion: add 'tools:replace="android:theme"' to <activity> element at [file] to override. After that, I added the tools:replace="android:theme" and got the Error:The prefix "tools" for attribute "tools:replace" associated with an element type "activity" is not bound. - user3239600
  • @ user3239600, try or move the "tools: replace" to the application tag or change the MY.VK.Transparent parent theme to a topic not from the support library - YuriiSPb