[mono-android] I Fixed a bug in ApiDemo
Tommy Hinrichs
tommy.hinrichs at gmail.com
Fri Mar 18 01:17:55 EDT 2011
All,
I've been learning Monodroid. I learn best by taking samples, and
understanding how they work.
In the process I generally restructure them, refactor them, see that
they still work, etc to prove to myself that I understand how they
work.
Going through this process with
https://github.com/mono/monodroid-samples/blob/master/ApiDemo/App/LocalService.cs
I found / fixed the following bug:
Line 60:
*var notification = new Notification (Resource.Drawable.stat_sample,
text, System.Environment.TickCount);*
The bug is that Notification expects milliseconds since epoch so we
should not be passing in tick count.
Please see http://developer.android.com/guide/topics/ui/notifiers/notifications.html
The fix is as follows:
*var sinceEpoch = DateTime.UtcNow - new DateTime(1970, 1, 1);*
*var msSinceEpoch = (long)sinceEpoch.TotalMilliseconds;*
*var notification = new Notification(Resource.Drawable.stat_sample,
text, msSinceEpoch); *
I've also fixed what I would consider a bug in
https://github.com/mono/monodroid-samples/blob/master/Button/Button.cs
Namely, the button text is reset when the user rotates there phone /
orientation changes occur. This was done fairly simply with static
properties, and adding context to the Bundle.
It was more code, so I didn't really think email was an appropriate venue.
I have a github profile, and I guess I could fork, fix, and request a
pull request.
It seems like a lot of work for such small fixes.
Is this the appropriate action?
I've never contributed anything to an open source project, so I'm
pretty new to the process.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110317/33abbc7e/attachment.html
More information about the Monodroid
mailing list