[英]Android reCaptcha forces orientation in portrait
我正在开发一个 Android 应用程序,该应用程序需要使用 reCaptcha 验证用户,并且我发生了奇怪的行为:如果屏幕方向为横向,点击按钮触发 reCaptcha API 方向更改为纵向,然后返回横向。
有办法解决这个问题吗? 我没有找到任何有关此的文档...
这是来自 SafetyNet 库的 API:
SafetyNet.getClient(this).verifyWithRecaptcha(ReCaptcha.RECAPTCHA_APP_KEY)
版本:
implementation("com.google.android.gms:play-services-safetynet:17.0.0")
当您旋转时,您的活动会刷新
您需要在活动标签中声明 android:configChanges="orientation|screenSize"
<activity
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
这将避免活动刷新我希望这会有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.