2017-03-06 60 views

回答

1

您在Run方法中缺少override關鍵字,並且此方法在首都中有「R」,請記住Xamarin是C#。

更改您實現這個:

public class DTime : TimerTask 
{ 
    private long time = Java.Lang.JavaSystem.CurrentTimeMillis(); 

    public DTime() 
    { 

    } 

    public override void Run() 
    { 
     time += 1000; 
    } 

    public long GetTime() 
    { 
     return time; 
    } 
} 
+0

謝謝apineda。如何在textview中查看小時,分鐘和秒鐘? 'Java.Util.Timer timer = new Java.Util.Timer(); timer.Schedule(new DTime(),0,1000);' – user2111639

相關問題