0

I have created android application in Eclipse java and which should be quit after 30mins if it is idle. I have used the following like for doing this.

Application idle time

I have tried the same in Xamarin Android, but it showing following error in touch and forceinterrupt methods,

Error in Thread

Community
  • 1
  • 1
Ponmalar
  • 6,871
  • 10
  • 50
  • 80

1 Answers1

0

There is no such keyword on .net at all. You have to use next:

private readonly object syncLock = new object();
//...
public void touch() 
{
    lock(syncLock) 
    { 
        /* code */ 
    }
}

public void forceInterrupt()
{
    lock(syncLock) 
    { 
        /* code */ 
    }
}
choper
  • 1,292
  • 8
  • 10