2

我正在使用 Xamarin 开发一个 android 应用程序,但我在使用后台线程时遇到了问题。在他们的多任务演示 ( http://docs.xamarin.com/samples/MultiThreading ) 中,作者创建了一个任务,假设完成一个长时间运行的过程。当这个任务正在运行并且方向改变时,我在输出窗口中得到以下内容:

05-15 03:12:19.379 E/WindowManager(32764): Activity androidmultithreading.screens.MainScreen has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@423e4aa8 that was originally added here
05-15 03:12:19.379 E/WindowManager(32764): android.view.WindowLeaked: Activity androidmultithreading.screens.MainScreen has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@423e4aa8 that was originally added here

当活动被终止或重新启动时,我找不到有关如何处理这些任务的任何信息。CancellationTokenSource 在这种情况下会起作用吗?

4

1 回答 1

2

Asked the same question on Xamarin's forums and here is the answer: http://forums.xamarin.com/discussion/comment/14047#Comment_14047

于 2013-05-20T14:09:45.067 回答