Simon
Simon

Reputation: 19938

Digits: user presses return without entering in phone number

I'm trying to use Digits in my app and tested this out on a sample app:

SCREEN 1 - MAINACTIVITY:

enter image description here

I press the button to use my number and it goes to the following screen:

SCREEN 2 - DIGITS SCREEN

enter image description here

Now in my test scenario, the user does not enter in a cellphone number at all. He decides not to use my app and presses the back button at the bottom of the screen to exit from the digits screen.

Instead of going back to SCREEN 1 which is my MainActivity, I would like the app to quit.

I'm looking for a callback method from digits to help me do so but can't seem to find one. How do I achieve the effect that I want?

Upvotes: 0

Views: 153

Answers (1)

brave_warrior
brave_warrior

Reputation: 550

You should clear navigation back stack, when you go to this screen and then override the method onBackPressed() and call there finish().

Check this how to clear back stack.

Upvotes: 1

Related Questions