Esempio n. 1
0
        public override bool ShouldOverrideUrlLoading(WebView view, string url)
        {
            //view.LoadUrl(url);

            var uri    = Android.Net.Uri.Parse(url);
            var intent = new Intent(Intent.ActionView, uri);

            ac.StartActivity(intent);
            return(true);
        }
Esempio n. 2
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     switch (item.ItemId)
     {
     case Resource.Id.menu_new_mail:
         Intent intent = new Intent(mActivity, typeof(ComposeEmailActivity));
         mActivity.StartActivity(intent);
         break;
     }
     return(true);
 }
Esempio n. 3
0
        private void GoogleMap_InfoWindowClick(object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            Step step = markerSteps[e.Marker.Id];

            Intent intent = new Intent(Activity, typeof(StopActivity));

            intent.PutExtra("Stop", step.Stop.Id);
            intent.PutExtra("Line", step.Route.Line.Id);

            Activity.StartActivity(intent);
        }
Esempio n. 4
0
        private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            int pos = e.Position;

            string orderObj = JsonConvert.SerializeObject(ledgerOrderList[pos]);

            Intent intent = new Intent(mActivity, typeof(AddOrderFirstActivity));

            intent.PutExtra("isEdit", true);
            intent.PutExtra("orderObj", orderObj);
            mActivity.StartActivity(intent);

            mActivity.OverridePendingTransition(Resource.Animation.animation_enter,
                                                Resource.Animation.animation_leave);
        }
Esempio n. 5
0
        // https://stackoverflow.com/questions/42360376/set-reminder-on-device-calendar-using-xamarin-forms-cross-platform-c-sharp
        // https://forums.xamarin.com/discussion/17001/how-do-i-open-the-android-calender-app-using-an-intent
        public void OpenCalendarApp()
        {
            var context = Android.App.Application.Context;
            // https://forums.xamarin.com/discussion/19857/how-to-access-packagemanager-and-start-activity-from-a-non-activity-based-class
            Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse("content://com.android.calendar/time/"));

            // Get list of calendars
            IList <ResolveInfo> activityList = context.PackageManager.QueryIntentActivities(intent, PackageInfoFlags.MatchDefaultOnly);

            // If there are not any calendar installed, show error message
            if (activityList.Count == 0)
            {
                MessagingCenter.Send <IOpenCal>(this, "CalendarAppMissing");
                return;
            }

            Android.App.Activity act = CrossCurrentActivity.Current.Activity;
            act.StartActivity(intent);
        }