示例#1
0
        public LocationListenerProxy(global::Android.Locations.LocationManager pLocationManager) : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
        {
            if (Handle != IntPtr.Zero)
            {
                return;
            }

            if (GetType() != typeof(LocationListenerProxy))
            {
                SetHandle(
                    global::Android.Runtime.JNIEnv.StartCreateInstance(GetType(), "(Landroid/location/LocationManager;)V", new JValue(pLocationManager)),
                    JniHandleOwnership.TransferLocalRef);
                global::Android.Runtime.JNIEnv.FinishCreateInstance(Handle, "(Landroid/location/LocationManager;)V", new JValue(pLocationManager));
                return;
            }

            if (id_ctor_Landroid_location_LocationManager_ == IntPtr.Zero)
            {
                id_ctor_Landroid_location_LocationManager_ = JNIEnv.GetMethodID(class_ref, "<init>", "(Landroid/location/LocationManager;)V");
            }
            SetHandle(
                global::Android.Runtime.JNIEnv.StartCreateInstance(class_ref, id_ctor_Landroid_location_LocationManager_, new JValue(pLocationManager)),
                JniHandleOwnership.TransferLocalRef);
            JNIEnv.FinishCreateInstance(Handle, class_ref, id_ctor_Landroid_location_LocationManager_, new JValue(pLocationManager));
        }
示例#2
0
 public static global::Android.Locations.Location GetLastKnownLocation(global::Android.Locations.LocationManager pLocationManager)
 {
     if (id_getLastKnownLocation_Landroid_location_LocationManager_ == IntPtr.Zero)
     {
         id_getLastKnownLocation_Landroid_location_LocationManager_ = JNIEnv.GetStaticMethodID(class_ref, "getLastKnownLocation", "(Landroid/location/LocationManager;)Landroid/location/Location;");
     }
     global::Android.Locations.Location __ret = global::Java.Lang.Object.GetObject <global::Android.Locations.Location> (JNIEnv.CallStaticObjectMethod(class_ref, id_getLastKnownLocation_Landroid_location_LocationManager_, new JValue(pLocationManager)), JniHandleOwnership.TransferLocalRef);
     return(__ret);
 }