Thanks Steven. How Do you trigger the bug? I've currently no ICS device
myself but I made some screenshots in the emulator running ICS some time
ago. But without crashes.
 On Nov 25, 2011 11:58 AM, "Steven Luo" <[email protected]>
wrote:

> On Ice Cream Sandwich, something -- possibly even in the Android
> framework classes (not in our code) -- is passing in null to a
> MessageListAdapter's unregisterOnDataSetObserver(), which causes a
> crash.
>
> We should really find out whether this is something we can properly fix
> or not, but in the meantime, wrap the superclass's method with our own
> method which checks for null before calling through to the superclass
> implementation.
> ---
>  .../src/org/yaaic/adapter/MessageListAdapter.java  |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/application/src/org/yaaic/adapter/MessageListAdapter.java
> b/application/src/org/yaaic/adapter/MessageListAdapter.java
> index 600e470..33bea86 100644
> --- a/application/src/org/yaaic/adapter/MessageListAdapter.java
> +++ b/application/src/org/yaaic/adapter/MessageListAdapter.java
> @@ -26,6 +26,7 @@ import org.yaaic.model.Conversation;
>  import org.yaaic.model.Message;
>
>  import android.content.Context;
> +import android.database.DataSetObserver;
>  import android.view.View;
>  import android.view.ViewGroup;
>  import android.widget.BaseAdapter;
> @@ -162,4 +163,15 @@ public class MessageListAdapter extends BaseAdapter
>     {
>         return getItem(position);
>     }
> +
> +    /**
> +     * XXX This is almost certainly covering up a bug elsewhere -- find
> it!
> +     */
> +    @Override
> +    public void unregisterDataSetObserver(DataSetObserver observer) {
> +        if (observer == null) {
> +            return;
> +        }
> +        super.unregisterDataSetObserver(observer);
> +    }
>  }
> --
> 1.7.2.5
>
>

Reply via email to