public Builder SetOpenUrlIntent(string url)
            {
                var uri    = AndroidUri.Parse(url);
                var intent = new AndroidIntent(AndroidIntent.ActionView);

                intent.SetData(uri);

                _ajo.CallAJO("setIntent", intent.AJO);
                return(this);
            }
Пример #2
0
 public static void StartAndroidGoodiesActivity()
 {
     using (var clazz = AGUtils.ClassForName(AndroidGoodiesActivityClassSignature))
     {
         using (var intent = new AndroidIntent(AGUtils.Activity, clazz))
         {
             AGUtils.StartActivity(intent.AJO);
         }
     }
 }
Пример #3
0
 public static void StartAndroidGoodiesActivity(int pickerType, Action <AndroidIntent> configurator)
 {
     using (var clazz = AGUtils.ClassForName(AndroidGoodiesActivityClassSignature))
     {
         using (var intent = new AndroidIntent(AGUtils.Activity, clazz))
         {
             intent.PutExtra(EXTRAS_PICKER_TYPE, pickerType);
             configurator(intent);
             AGUtils.StartActivity(intent.AJO);
         }
     }
 }
 public static void RefreshGallery(string filePath)
 {
     if (AGDeviceInfo.SDK_INT >= AGDeviceInfo.VersionCodes.KITKAT)
     {
         ScanFile(filePath, null);
     }
     else
     {
         var uri    = AndroidUri.FromFile(filePath);
         var intent = new AndroidIntent(AndroidIntent.ActionMediaMounted, uri);
         AGUtils.SendBroadcast(intent.AJO);
     }
 }
        public static void RequestPinShortcut(ShortcutInfo shortcut)
        {
            if (!AreShortCutsSupported)
            {
                return;
            }

            var intent =
                AndroidIntent.Wrap(AGSystemService.ShortcutService.CallAJO("createShortcutResultIntent", shortcut.ajo));

            intent.SetAction(AndroidIntent.ActionCreateShortCut);
            var pendingIntentSender = AndroidPendingIntent.GetActivity(intent.AJO, AGUtils.RandomId()).CallAJO("getIntentSender");

            AGSystemService.ShortcutService.CallBool("requestPinShortcut", shortcut.ajo, pendingIntentSender);
        }
 public static void RefreshGallery(string filePath)
 {
     if (AGDeviceInfo.SDK_INT >= AGDeviceInfo.VersionCodes.KITKAT)
     {
         using (var c = new AndroidJavaClass(MediaScannerConnectionClass))
         {
             c.CallStatic("scanFile", AGUtils.Activity, new[] { filePath }, null, null);
         }
     }
     else
     {
         var uri    = AndroidUri.FromFile(filePath);
         var intent = new AndroidIntent(AndroidIntent.ACTION_MEDIA_MOUNTED, uri);
         AGUtils.SendBroadcast(intent.AJO);
     }
 }
            public Builder SetOpenThisAppIntent(Dictionary <string, string> customData)
            {
                var androidIntent = AndroidIntent.Wrap(AGUtils.CurrentAppLaunchIntent);

                androidIntent.PutExtra(AGNotificationManager.OpenedWithNotificationParamKey, true);
                if (customData != null)
                {
                    foreach (var entry in customData)
                    {
                        var entryKey   = entry.Key;
                        var entryValue = entry.Value;
                        androidIntent.PutExtra(entryKey, entryValue);
                    }
                }

                _ajo.CallAJO("setIntent", androidIntent.AJO);
                return(this);
            }
Пример #8
0
 public static void SetExact(AndroidIntent intent, DateTime when, int id)
 {
     AGSystemService.AlarmService.Call("setExact", RTC_WAKEUP, CalcMillis(when),
                                       AndroidPendingIntent.GetBroadcast(intent.AJO, id));
 }
Пример #9
0
 public static void Cancel(AndroidIntent intent, int id)
 {
     AGSystemService.AlarmService.Call("cancel", AndroidPendingIntent.GetBroadcast(intent.AJO, id));
 }
Пример #10
0
 public static void SetRepeating(AndroidIntent intent, DateTime when, long intervalMillis, int id)
 {
     AGSystemService.AlarmService.Call("setRepeating", RTC_WAKEUP, CalcMillis(when), intervalMillis,
                                       AndroidPendingIntent.GetBroadcast(intent.AJO, id));
 }