按下后退按钮时停止两个线程

时间:2015-08-13 08:24:25

标签: android multithreading android-intent android-activity

当我给出我的线程名称时,它表明它无法解析符号。我想停止线程并在按下后退按钮时转到索引页 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using Microsoft.Maps.MapControl.WPF; namespace Geography { /// <summary> /// Interaction logic for Maps.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); myMap.Focus(); //Set map to Aerial mode with labels myMap.Mode = new AerialMode(); } } }

(indexactivity)

这是发现错误的地方。

1 个答案:

答案 0 :(得分:0)

Cannot resolve symbol t即将到来,因为您已在onCreate()方法中声明了此变量,并尝试在其他方法中使用它来删除回调。按照与变量j

相同的定义方法

在课堂级别定义此Runnable,如下所示

final Runnable t = null; // if you need final keep it, otherwise remove it

并更改

final Runnable t = new Runnable() {

t = new Runnable() {