Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to set android time

$
0
0

Hi,
I'm trying to set the device time this way

            Calendar c = Calendar.GetInstance(new Java.Util.Locale("it-IT"));
            c.Set(time.Year, time.Month, time.Day, time.Hour, time.Minute);
            AlarmManager am = (AlarmManager)this.GetSystemService(AlarmService);
            am.SetTime(c.TimeInMillis);

but i keep getting this error

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

any help?
Thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>