Putting a GC.Collect on the receiver callback seems to make the problem go
away... what's wrong here?
I'm posting the callback code, maybe I'm doing something the wrong way...

                Android.Util.Log.Verbose( "CockpitView", string.Format(
"OnTrackingBroadcastReceived( {0} )", intent.Action ) );

                GC.Collect();

                if ( intent.Action == TrackingService.ACTION_NEWLOCATION )
                {
                    lastSpeed = intent.GetIntExtra(
TrackingService.EXTRA_SPEED, 0 );

                    if ( speedvalueView != null )
                    {
                        int idColor = Resource.Color.theme_gray_light;

                        if ( lastSpeed >= 10 )
                        {
                            idColor = Resource.Color.theme_green;
                        }

                        if ( lastSpeed >= 80 )
                        {
                            idColor = Resource.Color.theme_orange;
                        }

                        if ( lastSpeed >= 120 )
                        {
                            idColor = Resource.Color.theme_red;
                        }

                        speedvalueView.SetTextColor( Resources.GetColor(
idColor ) );
                        speedvalueView.SetText( lastSpeed.ToString() );
                    }
                }

                if ( ( intent.Action == TrackingService.ACTION_STATECHANGED
) && ( intent.GetIntExtra( TrackingService.EXTRA_STATE, -1 ) ==
TrackingService.STATE_STOPPED ) )
                {
                    Finish();
                }


Cheers


On 5 November 2012 11:16, Goncalo Oliveira <[email protected]> wrote:

> Hi all,
>
> I'm having a consistent crash on my app after it's running on a few
> minutes. I basically have a background service broadcasting gps locations
> to the activity, and displaying it's speed. The receiver is registered
> onStart and unregistered onStop. The activity is keeping the screen on, so
> the activity is not even pausing. It all works for a few minutes and then,
> crash... The log doesn't seem to say much more than "Could not create epoll
> instance". I can replicate this on two different devices, one with 2.3.5,
> the other with 3.2.
>
> Am I missing something? How can I trap this?
> Any help would be much appreciated.
>
> Here's the logcat dump
> http://pastebin.com/WhVdbmRk
>
> Cheers
>
> --
> Gonçalo Oliveira
>



-- 
Gonçalo Oliveira
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to