your code force closing is preventable by a simple null check..
if(yourvariable != null){ do something}else{do something else or do nothing
and display an error message}. The question about whether youwant to share
global variable between
 activities is something you should really ask yourself... pass stuff to
other activities using intents or bundle and do null checks. that way you
can find out which activities are settting ur data to null and fix it..

On 12 April 2011 08:11, Christophe <[email protected]> wrote:

> hello everybody,
>
> I use a static variable to share data across all the activities of my
> apps.
> The problems is that sometimes this variable is set to null, which
> cause the others activities to crash (nullPointersException) ...
>
> does somebody have an idea of what could set the static variables to
> null ?
> regards,
> Christophe
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to