本文整理汇总了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();
}
}
示例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);
}
}
}
}
示例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;
}
示例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 ();
}
}