зеркало из https://github.com/mono/mail-archives.git
151 строка
6.6 KiB
HTML
151 строка
6.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [mono-android] Threading with Rotation
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Threading%20with%20Rotation&In-Reply-To=CAC30Ovizmru1PEXv9N-6kGQxSY-raB_ENK5K5dkyUhF1aTb6nw%40mail.gmail.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="007816.html">
|
|
<LINK REL="Next" HREF="007818.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[mono-android] Threading with Rotation</H1>
|
|
<B>Sayed Arian Kooshesh</B>
|
|
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=%5Bmono-android%5D%20Threading%20with%20Rotation&In-Reply-To=CAC30Ovizmru1PEXv9N-6kGQxSY-raB_ENK5K5dkyUhF1aTb6nw%40mail.gmail.com"
|
|
TITLE="[mono-android] Threading with Rotation">kooshesh at gmail.com
|
|
</A><BR>
|
|
<I>Tue Dec 13 23:51:10 EST 2011</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="007816.html">[mono-android] Threading with Rotation
|
|
</A></li>
|
|
<LI>Next message: <A HREF="007818.html">[mono-android] Threading with Rotation
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#7817">[ date ]</a>
|
|
<a href="thread.html#7817">[ thread ]</a>
|
|
<a href="subject.html#7817">[ subject ]</a>
|
|
<a href="author.html#7817">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>i'm sorry if my responses seem flamy but the majority of the work i've
|
|
had lately is fixing code of programmers like asshole here who have no
|
|
idea how to prgramm. How do they get jobs? I just wonder and wonder.
|
|
Do the clients go on like freelancer.com hoping to get low bid? Don't
|
|
you know that's how you get FUCKED? I mean, at least hire some talent
|
|
European (like the people who mange this list) or fucking stop hiring
|
|
Indians who don't know how to program, write shiity, shitty, code, and
|
|
end up on lists like this asking stupid ass questions about shit that
|
|
the developers don't need to help then with. If you can't use c# how
|
|
it should be, why are you using it to write an android app. You know
|
|
it's gonna leak memory and fail... fucking shit programmer.
|
|
|
|
I swear to god I might just hire someone to beat the shit out of these
|
|
guys. That might teach them to not take jobs that they can't handle.
|
|
|
|
On Tue, Dec 13, 2011 at 10:46 PM, Sayed Arian Kooshesh
|
|
<<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">kooshesh at gmail.com</A>> wrote:
|
|
><i> please stop using threads. pleas learn backgroundworker. or i will
|
|
</I>><i> find you. I will cut you open. I will eat your innards. is that threat
|
|
</I>><i> enough to make you write GOOD code? or are you forever doomed to bitch
|
|
</I>><i> on lists like this because you have problems. the problems being
|
|
</I>><i> shitty code and the solution being you STOP being a fucking
|
|
</I>><i> programmer.
|
|
</I>><i>
|
|
</I>><i> On Tue, Dec 13, 2011 at 9:31 PM, Jonathan Pryor <<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">jonp at xamarin.com</A>> wrote:
|
|
</I>>><i> On Nov 16, 2011, at 1:10 PM, emalamisura wrote:
|
|
</I>>>><i> A common issue with maintaining state is handling Rotation with multiple
|
|
</I>>>><i> threads in Android.  For instance if you start a thread, and then rotate the
|
|
</I>>>><i> phone before the thread is done with its work Android destroys the previous
|
|
</I>>>><i> Activity and generates a new one.  Any references you had to your previous
|
|
</I>>>><i> activity will cause a reference exception.
|
|
</I>>><i>
|
|
</I>>><i> Right. Don't do that. :-)
|
|
</I>>><i>
|
|
</I>>><i> I'm also not sure what scenario you're thinking of. Activities are tied to their Main thread -- it isn't safe to interact with them except via the main thread or Activity.RunOnUiThread() -- and anything associated with the Activity follows the same rules as well. This would include the LastNonConfigurationInstance value, as used at:
|
|
</I>>><i>
|
|
</I>>><i>        <A HREF="http://stackoverflow.com/a/8331994/83444">http://stackoverflow.com/a/8331994/83444</A>
|
|
</I>>><i>
|
|
</I>>><i> So the primary question is this: why are multiple threads using an Activity instance? If it's to use Activity.RunOnUiThread(), use an alternative, such as a Handler instance over the MainLooper:
|
|
</I>>><i>
|
|
</I>>><i>        <A HREF="http://support.xamarin.com/customer/portal/questions/34836-toast-in-service">http://support.xamarin.com/customer/portal/questions/34836-toast-in-service</A>
|
|
</I>>><i>
|
|
</I>>>><i> This becomes even more difficult
|
|
</I>>>><i> to handle in MonoDroid because alot of the semantics used in Java such as
|
|
</I>>>><i> using an internal static class inside your activity can't easily be
|
|
</I>>>><i> reproduced in C#
|
|
</I>>><i>
|
|
</I>>><i> I also don't understand this. Java's `static` nested classes are ~identical to C# nested types; it's non-`static` nested classes which differ.
|
|
</I>>><i>
|
|
</I>>><i> Thanks,
|
|
</I>>><i>  - Jon
|
|
</I>>><i>
|
|
</I>>><i> _______________________________________________
|
|
</I>>><i> Monodroid mailing list
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>>><i>
|
|
</I>>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i> --
|
|
</I>><i> Extreme Knowledge is not something for which he programs a computer
|
|
</I>><i> but for which his computer is programming him.
|
|
</I>><i>
|
|
</I>><i> -Wozniak
|
|
</I>
|
|
|
|
|
|
--
|
|
Extreme Knowledge is not something for which he programs a computer
|
|
but for which his computer is programming him.
|
|
|
|
-Wozniak
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="007816.html">[mono-android] Threading with Rotation
|
|
</A></li>
|
|
<LI>Next message: <A HREF="007818.html">[mono-android] Threading with Rotation
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#7817">[ date ]</a>
|
|
<a href="thread.html#7817">[ thread ]</a>
|
|
<a href="subject.html#7817">[ subject ]</a>
|
|
<a href="author.html#7817">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
|
|
mailing list</a><br>
|
|
</body></html>
|