hey guys in this tutorial I'm going to
show you how you can implement this
press back again to exit functionality
which only closes your app if you press
back two times within a certain time
frame okay let's implement this first we
are going to need a long variable which
we call private long back pressed time
in this back pressed time variable we
are going to save the time in
milliseconds of the click now we
overwrite on back pressed we press ctrl
or search for on back pressed and press
Enter ok at the end of our on back
the pressed method we are going to set back
press time to a system dot current time
in Millie's so our back press time will
be set to the current time in
milliseconds but before this we are
going to create an if-else statement so
we say if back press time plus 2000
which equates to seconds is bigger than
system current time in Millie's so this
is comparing the time of the first click
to the time of our second click so if
our second click is within these two
seconds after the first click the if
part is going to heaven and in this part
we are going to put this
Subhan back pressed we cut it out here
and put it here and also we are going to
write return so we leave this method
after the if the part is happening in the
elf statement we are going to create
this toast message so is a toast dot
make the text as the context repairs get
In the pasted context we give it a string which
was a press back again to its exit and
also, we give it a length with a toast dot
length short and also we have to call
show understood now let's test it
if I wait longer than two seconds it's
not living and if I click two times
within these two seconds, it's living Deb
but if you may have noticed the toast
didn't disappear with the app itself it
lasted a bit longer so let's change this
let's put our toes into a toast variable
with private toast leg toast, we delete
the show part down here and say okay
Beck toast
equals toast make text and the next line
recall show on our back toast and here
in our is part we are going to call the
egg toast or cancel before closing the
app so if we close the app the toast is
going to get canceled immediately let's
test it and as you can see the toast
disappears immediately it says it again disappears
hey guys indes tutorial going to
implement web die unto that we can use
of you for example motto show user guide
wandbilder browser app auf kurs wir
kennen navigate rudolf seiters
entwickelnder wie get back using our
beck button
okay let's build ist vertriebsaktivität
layout which will contain or that you
are change of constraints layout Uhr
relativ layout die liedtext juli
entweder implement view desmond tutu
felder homescreen entwickelt aus change
the closing tag hier entwarf juni ziehen
die Twitter id where you okay let's go
back to create mit wie indische
leistungsbewertung so wie sie web due.de
Kurz cars to find you where d.id invited
us- ettenauer xml file semikolon
zunächst review dort laut judith sterl
url hier seht ihr ende des case that
simply didn't you load google social
studies and would not die seit innen
the external browser is not with no angels
wie gullotti URL method and view client
your web client der zeitnot ist seit
juli trifft in moderne browser app and
of course I en suite internet access to
load das sei so wie goldman die fest
feiern
entwickler erbach des application and
review spanischen den mini thermischen
android dort per mission dort internet
entwickle orf internet per mission power
aep ok jetzt testet wwf website wie can
say something bei defi klickte back but
now they just leave der app sowie have
to change das vor dass wie go back to
the activity of the go outside of the skate
metals and process control the search
for und beck presst wie have to wait is
matt so usually super dort a beck
prädikat bridges close up in das case
you can go back in the history of you
can go back denn dort go back end denn
wie move back to the last week and go
back we welcome back christmette trading
kloster epe des case perfekt 4 want to
change the settings of you you can
create an instance of web settings with web
settings web settings iq dort get things
you can take des webs settings variable
in Karl different things on net so ewl
list of different options for example
javascript enabled replaced with you can
now with something wrong type in android
klick und das seid hier in westerbeck
button Nico back to the last Zeit
Entwickler back again and advocacy
bombeck bostridge dem kloster st
genau Heute implement web you won't
trade it branche fordert deshalb holt
don't forget you like entscheide video
and if you want more tutorials