当前位置: 首页>>代码示例>>C#>>正文


C# Android.GetStringExtra方法代码示例

本文整理汇总了C#中Android.GetStringExtra方法的典型用法代码示例。如果您正苦于以下问题:C# Android.GetStringExtra方法的具体用法?C# Android.GetStringExtra怎么用?C# Android.GetStringExtra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android的用法示例。


在下文中一共展示了Android.GetStringExtra方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnActivityResult

 protected override void OnActivityResult(int requestCode, Result resultCode, Android.Content.Intent data)
 {
     if (resultCode == Result.Ok)
     {
         var barcode = data.GetStringExtra("com.ebay.redlasersdk.barcode");
         var barcodeType = data.GetStringExtra("com.ebay.redlasersdk.barcodetype");
         Log.Debug("TESTApp", "BARCODE: " + barcode);
         new AlertDialog.Builder(this).SetTitle("Scan Result").SetMessage(barcodeType + ": " + barcode)
         .SetNegativeButton("OK", (Dialog, whichButton) => { }).Show();
     }
 }
开发者ID:pcoder,项目名称:RedLaserDroid,代码行数:11,代码来源:Activity1.cs

示例2: OnHandleIntent

        protected override void OnHandleIntent(Android.Content.Intent intent)
        {
            StreamReader reader = null;
            string zipCode = intent.GetStringExtra ("lqe");
            try {

                var httpClient = new HttpClient ();
                // Construct the URL for the OpenWeatherMap query
                // Possible parameters are available at OWM's forecast API page, at
                // http://openweathermap.org/API#forecast
                Task<string> getJSON = httpClient.GetStringAsync ("http://api.openweathermap.org/data/2.5/forecast/daily?q=" + zipCode + ",us&mode=json&units=metric&cnt=7&APPID=83fde89b086ca4abec16cb2a8c245bb8");
                string JSON = getJSON.Result;

                getWeatherDataFromJson (JSON, zipCode);
            } catch (IOException e) {
                Log.WriteLine (LogPriority.Error, "PlaceholderFragment", "Error ", e);
                // If the code didn't successfully get the weather data, there's no point in attempting
                // to parse it.
            } finally {
                if (reader != null) {
                    try {
                        reader.Close ();
                    } catch (IOException e) {
                        Log.WriteLine (LogPriority.Error, "PlaceholderFragment", "Error closing stream", e);
                    }
                }

            }
        }
开发者ID:Screech129,项目名称:WeatherApp,代码行数:29,代码来源:SunshineService.cs

示例3: OnNewIntent

        protected override void OnNewIntent(Android.Content.Intent intent)
        {
            base.OnNewIntent(intent);

            _selectedAlarm = JsonConvert.DeserializeObject<AlarmData>(intent.GetStringExtra(Constants.AlarmsData_Extra));
            _requestId = _selectedAlarm.RequestId;

            SupportActionBar.Title = _selectedAlarm.Name;
        }
开发者ID:foxanna,项目名称:SimpleLocationAlarm,代码行数:9,代码来源:AlarmScreen.cs

示例4: handleDecodeData

        private void handleDecodeData(Android.Content.Intent i)
        {
            // check the intent action is for us
            if (i.Action.Equals (ourIntentAction)) {
                String source = i.GetStringExtra(SOURCE_TAG);
                String data = i.GetStringExtra(DATA_STRING_TAG);

                //INSERT EN THREAD + PROGRESS
                //ShowProgressInsert (progress => AndHUD.Shared.Show (this, "Insertion ... " + progress + "%", progress, MaskType.Clear));
                Thread threadinsert = new Thread (() => GetPosData (data));
                threadinsert.Start ();

            }
        }
开发者ID:Dealtis,项目名称:DCS,代码行数:14,代码来源:MenuActivity.cs


注:本文中的Android.GetStringExtra方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。