Home > Mobile >  How to perform onPause () before, display the toast?
How to perform onPause () before, display the toast?

Time:10-05

I want to display a toast before the activity to suspend, rewrite the onPause () method is as follows: @ Override protected void onPause () {toast. MakeText (this, "Paused", toast. LENGTH_LONG), show (); Super. OnPause (); } according to this, only when the onPause () method at the end of the activity will be suspended, at that time, toast information but did not show,

CodePudding user response:

The general and stop, your interface is not currently visible, toast did not show, you can call it log see, don't use the toast

CodePudding user response:

reference 1st floor zhang106209 response:
the general with the stop, your interface is not currently visible, toast did not show, you can call it log see, do not use toast


Didn't see an error log, I want to be in the user press the home key when prompted "XXXapp you have left, please do not input the information such as password" on the client, not toast: are there any other way to do it?

CodePudding user response:

It is ok to you to monitor home button

CodePudding user response:

To switch to the Application as a context

CodePudding user response:

Tried, as you write, press the HOME key, keys or tasks, all normal Toast, you Log under the Log output, whether onPause is performed after the HOME button

CodePudding user response:

You use the millet mobile phone, millet mobile phone inside the app permissions have the authority, "the background pop-up interface" open a line, the specific code can use to judge the customer service, you can ask millet backstage before start the app permissions can judge, estimate the also cool.
  • Related