[Android] [PATCH] Prevent rare NPE in AudioPlayer

Edward Wang edward.c.wang at compdigitec.com
Wed Oct 29 22:30:40 CET 2014


On Wed, Oct 29, 2014 at 9:21 AM, Geoffrey Métais
<geoffrey.metais at gmail.com> wrote:
> +        if (activity != null)
> +            activity.showAudioPlayer();
>      }
>
>      public void hide() {
>          MainActivity activity = (MainActivity)getActivity();
> -        activity.hideAudioPlayer();
> +        if (activity != null)
> +            activity.hideAudioPlayer();

Looks fine.

Regards,
 Edward Wang


More information about the Android mailing list