[Android] Check context validity while browsing

Thomas Guillem thomas at gllm.fr
Wed Jun 22 22:16:34 CEST 2016


 
On Wed, Jun 22, 2016, at 21:41, Geoffrey Métais wrote:
> #Android
>
> It's all callback based, you cannot know the state of your
> activity/fragment/service/whatever when you run a threaded task.
> Thus, behaviour is slightly different with some manufacturer.
> e.g. : With Samsung or custom roms, we commonly have such "impossible"
>      bugs
 
But why you don't check the context before running the background task ?
It's not null here, it can't become null after
 
>
> On Wed, Jun 22, 2016 at 8:58 PM Jean-Baptiste Kempf
> <jb at videolan.org> wrote:
>> On 22 Jun, Geoffrey Métais wrote :
>>  > -                if (mReadyToDisplay) {
>>  > +                if (mReadyToDisplay && context != null) {
>>
>>  How can context be null here? o_O
>>
>>  With my kindest regards,
>>
>>  --
>>  Jean-Baptiste Kempf
>> http://www.jbkempf.com/ - +33 672 704 734
>>  Sent from my Electronic Device
>>  _______________________________________________
>>  Android mailing list
>> Android at videolan.org
>> https://mailman.videolan.org/listinfo/android
> _________________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20160622/58eb3df0/attachment.html>


More information about the Android mailing list