0

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?

Simon
  • 19,658
  • 27
  • 149
  • 217

1 Answers1

1

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.

Community
  • 1
  • 1
brave_warrior
  • 540
  • 1
  • 4
  • 16
  • Omg. Once again I looked too much into the details and not a t the big picture. Thanks, I will try that. – Simon Mar 13 '16 at 11:48