How to send the application to onStop () when I press the button?
up vote
0
down vote
favorite
I try do this:
public void f(View ew ){
onStop();
}
but don't work. I need the button with the attribute onClick = "f" to send its application to onStop (). Any suggestion?
android methods exit
|
show 2 more comments
up vote
0
down vote
favorite
I try do this:
public void f(View ew ){
onStop();
}
but don't work. I need the button with the attribute onClick = "f" to send its application to onStop (). Any suggestion?
android methods exit
Why would you need to call onStop? It's just a lifecycle method?
– Martin Lund
Nov 19 at 14:22
1
Have you try to call finish() ?
– Benjamin
Nov 19 at 14:23
finish() I think end on method onDestroy()
– user48571
Nov 19 at 14:32
1
if finish() is called from onCreate then it will call onDestroy(), if it is called from onStart() it will call onStop() - still wondering why you would do it?
– Martin Lund
Nov 19 at 14:35
1
stackoverflow.com/questions/8515936/… I would recommend a short read on the lifecycle methods here :)
– Martin Lund
Nov 19 at 14:38
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I try do this:
public void f(View ew ){
onStop();
}
but don't work. I need the button with the attribute onClick = "f" to send its application to onStop (). Any suggestion?
android methods exit
I try do this:
public void f(View ew ){
onStop();
}
but don't work. I need the button with the attribute onClick = "f" to send its application to onStop (). Any suggestion?
android methods exit
android methods exit
asked Nov 19 at 14:20
user48571
107
107
Why would you need to call onStop? It's just a lifecycle method?
– Martin Lund
Nov 19 at 14:22
1
Have you try to call finish() ?
– Benjamin
Nov 19 at 14:23
finish() I think end on method onDestroy()
– user48571
Nov 19 at 14:32
1
if finish() is called from onCreate then it will call onDestroy(), if it is called from onStart() it will call onStop() - still wondering why you would do it?
– Martin Lund
Nov 19 at 14:35
1
stackoverflow.com/questions/8515936/… I would recommend a short read on the lifecycle methods here :)
– Martin Lund
Nov 19 at 14:38
|
show 2 more comments
Why would you need to call onStop? It's just a lifecycle method?
– Martin Lund
Nov 19 at 14:22
1
Have you try to call finish() ?
– Benjamin
Nov 19 at 14:23
finish() I think end on method onDestroy()
– user48571
Nov 19 at 14:32
1
if finish() is called from onCreate then it will call onDestroy(), if it is called from onStart() it will call onStop() - still wondering why you would do it?
– Martin Lund
Nov 19 at 14:35
1
stackoverflow.com/questions/8515936/… I would recommend a short read on the lifecycle methods here :)
– Martin Lund
Nov 19 at 14:38
Why would you need to call onStop? It's just a lifecycle method?
– Martin Lund
Nov 19 at 14:22
Why would you need to call onStop? It's just a lifecycle method?
– Martin Lund
Nov 19 at 14:22
1
1
Have you try to call finish() ?
– Benjamin
Nov 19 at 14:23
Have you try to call finish() ?
– Benjamin
Nov 19 at 14:23
finish() I think end on method onDestroy()
– user48571
Nov 19 at 14:32
finish() I think end on method onDestroy()
– user48571
Nov 19 at 14:32
1
1
if finish() is called from onCreate then it will call onDestroy(), if it is called from onStart() it will call onStop() - still wondering why you would do it?
– Martin Lund
Nov 19 at 14:35
if finish() is called from onCreate then it will call onDestroy(), if it is called from onStart() it will call onStop() - still wondering why you would do it?
– Martin Lund
Nov 19 at 14:35
1
1
stackoverflow.com/questions/8515936/… I would recommend a short read on the lifecycle methods here :)
– Martin Lund
Nov 19 at 14:38
stackoverflow.com/questions/8515936/… I would recommend a short read on the lifecycle methods here :)
– Martin Lund
Nov 19 at 14:38
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376600%2fhow-to-send-the-application-to-onstop-when-i-press-the-button%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why would you need to call onStop? It's just a lifecycle method?
– Martin Lund
Nov 19 at 14:22
1
Have you try to call finish() ?
– Benjamin
Nov 19 at 14:23
finish() I think end on method onDestroy()
– user48571
Nov 19 at 14:32
1
if finish() is called from onCreate then it will call onDestroy(), if it is called from onStart() it will call onStop() - still wondering why you would do it?
– Martin Lund
Nov 19 at 14:35
1
stackoverflow.com/questions/8515936/… I would recommend a short read on the lifecycle methods here :)
– Martin Lund
Nov 19 at 14:38