Whenever I press the back button on the SignInIntentBuilder activity, the app just crashes. How can this be fixed? Here is a picture of my code.

Another thing to note is that the highlighted text never gets called:

@ryandailey100 we need more information to assist you such as what version of FirebaseUI you are using and a crash log. You can got the logcat monitor in Android Studio to find the crash logs.
Here is the crash log:
07-02 14:03:50.547 25805-25805/com.daileyprod.clife E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.daileyprod.clife, PID: 25805
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=123, result=0, data=null} to activity {com.daileyprod.clife/com.daileyprod.clife.StartUpActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter data
at android.app.ActivityThread.deliverResults(ActivityThread.java:4252)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4295)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1583)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6290)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter data
at com.daileyprod.clife.StartUpActivity.onActivityResult(StartUpActivity.kt:0)
at android.app.Activity.dispatchActivityResult(Activity.java:7022)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4248)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4295)聽
at android.app.ActivityThread.-wrap20(ActivityThread.java)聽
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1583)聽
at android.os.Handler.dispatchMessage(Handler.java:102)聽
at android.os.Looper.loop(Looper.java:154)聽
at android.app.ActivityThread.main(ActivityThread.java:6290)聽
at java.lang.reflect.Method.invoke(Native Method)聽
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)聽
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)聽
07-02 14:03:50.547 25805-25805/com.daileyprod.clife D/AppTracker: App Event: crash
07-02 14:03:50.559 25805-25805/com.daileyprod.clife I/Process: Sending signal. PID: 25805 SIG: 9
Oh duh!!! The number of times that's happen to me since converting my app to Kotlin, it should have been the first thing I looked at, sorry! 鈽猴笍 Just mark the data intent as @Nullable by adding a ? after the Intent type declaration. So it should look like so: data: Intent?.
Perfect that did the trick! Thanks so much 馃憤
What if its in java ?
@ravich528798 If you are using Java, it is probably something different. You should provide more information, maybe create a new issue with logs and stuff
`if (firebaseAuth.getCurrentUser() != null) {
startActivity(new Intent(Login.this, MainActivity.class));
} else {
List<AuthUI.IdpConfig> providers = Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setIsSmartLockEnabled(false)
.setTheme(R.style.GreenTheme)
.setTosUrl("https://termsfeed.com/blog/terms-conditions-mobile-apps/")
.setPrivacyPolicyUrl("https://superapp.example.com/privacy-policy.html")
.setAvailableProviders(providers)
.build(),
RC_SIGN_IN);
}`
this is my code which starts intent. When I press back button it goes to an empty intent
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (resultCode !== Activity.RESULT_CANCELED) {
// write code here , using data Intent
//Like set Image in ImageView
}
}
Try this One It's Working for me "data: Intent?"
thanks, I resolved it!
thanks guy
Most helpful comment
Oh duh!!! The number of times that's happen to me since converting my app to Kotlin, it should have been the first thing I looked at, sorry! 鈽猴笍 Just mark the
dataintent as @Nullable by adding a?after theIntenttype declaration. So it should look like so:data: Intent?.