我正在开发一个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>
这将避免刷新活动希望对您有所帮助