Jun 9 | 3:50 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 9 | 4:00 PM |
Steve S. | has entered the room |
Mark M. |
hello, Steve!
|
Mark M. |
how can I help you today?
|
Steve S. |
Hi Mark!
|
Steve S. |
Let me upload my question...
|
Steve S. |
View paste
|
Jun 9 | 4:05 PM |
Mark M. |
no
|
Mark M. |
onReceive() is called on the main application thread
|
Mark M. |
which means that, by definition, it is either happening before onResume(), in between onResume() and onPause(), or after onPause()
|
Mark M. |
it cannot happen simultaneously with any of that
|
Mark M. |
so, either the broadcast happens when you are not registered (and so the broadcast is ignored)
|
Mark M. |
or the broadcast happens when you are registered, and so you have a valid Activity to work with
|
Steve S. |
Great. That's very helpful.
|
Steve S. |
I have one other question today about a minor point.
|
Steve S. |
If I start a new activity (call startActivity()), do I need to call finish() on the old one?
|
Mark M. |
um, "need to" is a strong term
|
Mark M. |
it all depends on what you want to have happen when the user presses BACK from the second activity
|
Steve S. |
ok
|
Mark M. |
so, if you specifically want a BACK press from the second activity to not return to the first activity, but to go one back from that (e.g., home screen), then sure, finish() the first activity
|
Mark M. |
if, OTOH, you want the second activity to return to the first activity, you would not call finish()
|
Jun 9 | 4:10 PM |
Steve S. |
Ok. And you mean BACK as opposed to UP?
|
Mark M. |
yes, I mean BACK, as in the triangle button on the navigation bar of an Android 5.0+
|
Mark M. |
and the equivalents on other environments
|
Steve S. |
Great. Thank you so much, Mark! No other questions today.
|
Mark M. |
ok
|
Mark M. |
happy to be useful!
|
Steve S. |
Have a great rest of your day!
|
Mark M. |
you too!
|
Steve S. |
Very useful! See you next time.
|
Steve S. | has left the room |
Jun 9 | 4:15 PM |
Robert U. | has entered the room |
Mark M. |
hello, Robert!
|
Mark M. |
how can I help you today?
|
Jun 9 | 4:20 PM |
Robert U. |
Hi, Mark. I do have a couple of questions, but no time to ask them now; going to an offsite meeting in a few minutes.
|
Mark M. |
ok
|
Robert U. |
I just wanted to make sure I could get into the chat room and ask questions later on, tomorrow perhaps.
|
Mark M. |
the next chat is Saturday at 9am US Eastern
|
Robert U. |
I'm amazed no one else is here. You're a great resource for all things Android.
|
Robert U. |
Yes, I see that.
|
Mark M. |
someone was here earlier, asked two questions, and left
|
Mark M. |
one downside of Campfire is that you can't scroll back to chat history from before you joined, so you can't see those chat entries, at least until I publish the full transcript
|
Robert U. |
One of the problems I'm having has to do with BLE. I have a code snippet that works on pre-Marshmallow devices, but not Marshmallow.
|
Robert U. |
I thought it was a permissions problem, but apparently not.
|
Mark M. |
I doubt that I can help, as I have not used any of the Bluetooth APIs, but you're welcome to ask
|
Jun 9 | 4:25 PM |
Robert U. |
The other question is about permissions in Marshmallow in general. I'll ask the next time I can get into the chat, maybe Saturday.
|
Mark M. |
ok
|
Robert U. |
'bye, and have a good weekend.
|
Mark M. |
you too!
|
Jun 9 | 4:40 PM |
Robert U. | has left the room |
Jun 9 | 5:00 PM |
Mark M. | turned off guest access |