本文整理匯總了C#中Android.GetSystemService方法的典型用法代碼示例。如果您正苦於以下問題:C# Android.GetSystemService方法的具體用法?C# Android.GetSystemService怎麽用?C# Android.GetSystemService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Android
的用法示例。
在下文中一共展示了Android.GetSystemService方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetDeviceId
public static string GetDeviceId(Android.Content.Context context)
{
if (deviceID == String.Empty)
{
Android.Telephony.TelephonyManager telephonyMgr = context.GetSystemService(Android.Content.Context.TelephonyService) as Android.Telephony.TelephonyManager;
deviceID = telephonyMgr.DeviceId == null ? "UNAVAILABLE" : telephonyMgr.DeviceId;
//deviceID = telephonyMgr.Line1Number == null ? "UNAVAILABLE" : telephonyMgr.Line1Number;
}
return deviceID;
}
示例2: GetAppearingAnimator
public override ObjectAnimator GetAppearingAnimator (Android.Content.Context context)
{
Point outPoint = new Point ();
IWindowManager wm = context.GetSystemService (Context.WindowService).JavaCast<IWindowManager>();
wm.DefaultDisplay.GetSize (outPoint);
ObjectAnimator animator = ObjectAnimator.OfPropertyValuesHolder (
PropertyValuesHolder.OfFloat ("alpha", 0f, 1f),
PropertyValuesHolder.OfFloat ("translationY", outPoint.Y / 2f, 0f),
PropertyValuesHolder.OfFloat ("rotation", -45f, 0f));
animator.SetDuration ((long)(200 * mSpeedFactor));
return animator;
}
示例3: SetTeleManager
public static void SetTeleManager(Android.Content.Context a)
{
TeleManager = (Android.Telephony.TelephonyManager)a.GetSystemService(Context.TelephonyService);
}