0

I'm developing an Android app that needs to validate user with reCaptcha and I'm occurred on strange behaviour: if screen orientation is in landscape, tapping button that fires reCaptcha API orientation changhes to portrait and then back to landscape.

There is a way to fix this? I'm not found any documentation about this...

Here is API from SafetyNet lib:

SafetyNet.getClient(this).verifyWithRecaptcha(ReCaptcha.RECAPTCHA_APP_KEY) 

Version:

 implementation("com.google.android.gms:play-services-safetynet:17.0.0")
Lorenzo
  • 116
  • 1
  • 5

1 Answers1

-1

When you rotate your activity gets refreshed

You need to declare android:configChanges="orientation|screenSize" in activity tag

<activity
         android:configChanges="orientation|screenSize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

this will avoid activity refresh I hope this will help

Amin Pinjari
  • 2,129
  • 3
  • 25
  • 53
  • It turns out that i'm not rotating the screen, is reCaptcha that automatically force this behaviour! – Lorenzo Oct 11 '19 at 13:29