Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin Android C#计时器错误_C#_Android_Timer_Xamarin - Fatal编程技术网

Xamarin Android C#计时器错误

Xamarin Android C#计时器错误,c#,android,timer,xamarin,C#,Android,Timer,Xamarin,我的android应用程序在某个地方使用计时器。 我得到一个例外,当时间超过一小时(3600000)时,它说周期太长 myTime = "3600000"; TempTimer = new System.Threading.Timer ((o) => { ContentCheck(); // function call/ Void call <---------- }, null, 0, Int64.Parse(myTime) ); myTime=“3600000”;

我的android应用程序在某个地方使用计时器。 我得到一个例外,当时间超过一小时(3600000)时,它说周期太长

myTime = "3600000";

TempTimer = new System.Threading.Timer ((o) => {
    ContentCheck(); // function call/ Void call <----------
}, null, 0, Int64.Parse(myTime)  );
myTime=“3600000”;
试探计时器=新的System.Threading.Timer((o)=>{
ContentCheck();//函数调用/无效调用

这里,计时器实例的interval属性是Double类型。这样可以存储非常大的值。这应该适合您。

为什么要将interval存储为字符串?涉及JSON服务器事务的长篇大论..所以它不是只存储在一起的。但这不重要..计时器interval为Double?.太好了!!谢谢你U
Timer timer = new Timer();
        timer.Interval = 3600000; 
        timer.AutoReset = false; 
        timer.Start ();
        timer.Elapsed+= Timer_Elapsed;


    void Timer_Elapsed (object sender, ElapsedEventArgs e)
    {
        Console.WriteLine("Timer has gone off");
    }