本文整理汇总了C#中Android.Content.Intent.PutStringArrayListExtra方法的典型用法代码示例。如果您正苦于以下问题:C# Intent.PutStringArrayListExtra方法的具体用法?C# Intent.PutStringArrayListExtra怎么用?C# Intent.PutStringArrayListExtra使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Content.Intent
的用法示例。
在下文中一共展示了Intent.PutStringArrayListExtra方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddReply_Click
private void AddReply_Click(object sender, EventArgs e)
{
Intent myIntent = new Intent(this, typeof(AddReply));
myIntent.PutStringArrayListExtra("persistent data", persistentData);
myIntent.PutStringArrayListExtra("post id", postID);
myIntent.PutStringArrayListExtra("query text", query);
StartActivity(myIntent);
}
示例2: SchedAppt_Click
private void SchedAppt_Click(object sender, EventArgs e)
{
List<string> recieved = new List<string>();
List<string> data = new List<string>();
Core myCore = new Core(persistentData);
data.Add("04");
recieved = myCore.messageHandler(data);
Intent myIntent = new Intent(this, typeof(ScheduleAppointment));
myIntent.PutStringArrayListExtra("doctor list", recieved);
myIntent.PutStringArrayListExtra("persistent data", persistentData);
StartActivity(myIntent);
}
示例3: ViewPosts_Click
private void ViewPosts_Click(object sender, EventArgs e)
{
List<string> recieved = new List<string>();
List<string> data = new List<string>();
Core myCore = new Core(persistentData);
data.Add("08");
recieved = myCore.messageHandler(data);
Intent myIntent = new Intent(this, typeof(ViewForumPosts));
myIntent.PutStringArrayListExtra("posts list", recieved);
myIntent.PutStringArrayListExtra("persistent data", persistentData);
StartActivity(myIntent);
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
// Set our view from the "main" layout resource.
SetContentView (Resource.Layout.Main);
// Get our UI controls from the loaded layout:
EditText phoneNumberText = FindViewById<EditText>(Resource.Id.PhoneNumberText);
Button translateButton = FindViewById<Button>(Resource.Id.TranslateButton);
Button callButton = FindViewById<Button>(Resource.Id.CallButton);
Button callHistoryButton = FindViewById<Button> (Resource.Id.CallHistoryButton);
// Disable the "Call" button.
callButton.Enabled = false;
// Add code to translate number.
string translatedNumber = string.Empty;
translateButton.Click += (object sender, EventArgs e) => {
// Translate user's alphanumeric phone number to numeric.
translatedNumber = Core.PhonewordTranslator.ToNumber(phoneNumberText.Text);
if (String.IsNullOrWhiteSpace(translatedNumber)) {
callButton.Text = "Call";
callButton.Enabled = false;
} else {
callButton.Text = "Call " + translatedNumber;
callButton.Enabled = true;
}
};
callButton.Click += (object sender, EventArgs e) => {
// On "Call" button click, try to dial phone number.
var callDialog = new AlertDialog.Builder(this);
callDialog.SetMessage("Call " + translatedNumber + "?");
callDialog.SetNeutralButton("Call", delegate {
// Add dialed number to list of called numbers.
phoneNumbers.Add(translatedNumber);
// Enable the Call History button.
callHistoryButton.Enabled = true;
// Create intent to dial phone.
var callIntent = new Intent(Intent.ActionCall);
callIntent.SetData(Android.Net.Uri.Parse("tel:" + translatedNumber));
StartActivity(callIntent);
});
callDialog.SetNegativeButton("Cancel", delegate {});
// Show the alert dialog to the user and wait for response.
callDialog.Show();
};
callHistoryButton.Click += (sender, e) => {
var intent = new Intent(this, typeof(CallHistoryActivity));
intent.PutStringArrayListExtra("phone_numbers", phoneNumbers);
StartActivity(intent);
};
}
示例5: Login_Click
private void Login_Click(object sender, EventArgs e)
{
//declare variables for getting text from UI
EditText usernameText = FindViewById<EditText>(Resource.Id.usernameText);
EditText passwordText = FindViewById<EditText>(Resource.Id.passwordText);
//EditText ipText = FindViewById<EditText>(Resource.Id.ipText);
List<string> persistentData = new List<string>();
persistentData.Add(ip);
persistentData.Add(usernameText.Text);
/*if (usernameText.Text == null)
LoginFailedAlert("Username cannot be blank");
if (usernameText.Text == null)
LoginFailedAlert("Password cannot be blank");*/
Core myCore = new Core(persistentData);
List<string> recieved = new List<string>();
List<string> data = new List<string>();
data.Add("01");
data.Add(usernameText.Text);
data.Add(passwordText.Text);
recieved = myCore.messageHandler(data);
persistentData.Add(recieved[2]);
//create new intent to start profile activity
Intent myIntent = new Intent(this, typeof(ProfileActivity));
myIntent.PutStringArrayListExtra("persistent data", persistentData);
//Start profile activity is correct login data otherwise display incorrect username/password alert
if (recieved[1] == "1")
{
StartActivity(myIntent);
}
else
{
LoginFailedAlert("Incorrect username or password. Please try again");
}
}
示例6: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
EditText phoneNumberText = FindViewById<EditText>(Resource.Id.PhoneNumberText);
Button translateButton = FindViewById<Button>(Resource.Id.TranslateButton);
Button callButton = FindViewById<Button>(Resource.Id.CallButton);
Button callHistoryButton = FindViewById<Button>(Resource.Id.CallHistoryButton);
// "Call" を Disable にします
callButton.Enabled = false;
// 番号を変換するコードを追加します。
string translatedNumber = string.Empty;
translateButton.Click += (object sender, EventArgs e) =>
{
// ユーザーのアルファベットの電話番号を電話番号に変換します。
translatedNumber = Core.PhonewordTranslator.ToNumber(phoneNumberText.Text);
if (String.IsNullOrWhiteSpace(translatedNumber))
{
callButton.Text = "Call";
callButton.Enabled = false;
}
else
{
callButton.Text = "Call " + translatedNumber;
callButton.Enabled = true;
}
};
callButton.Click += (object sender, EventArgs e) =>
{
// "Call" ボタンがクリックされたら電話番号へのダイヤルを試みます。
var callDialog = new AlertDialog.Builder(this);
callDialog.SetMessage("Call " + translatedNumber + "?");
callDialog.SetNeutralButton("Call", delegate
{
// 掛けた番号のリストに番号を追加します。
phoneNumbers.Add(translatedNumber);
// Call History ボタンを有効にします。
callHistoryButton.Enabled = true;
// 電話への intent を作成します。
var callIntent = new Intent(Intent.ActionCall);
callIntent.SetData(Android.Net.Uri.Parse("tel:" + translatedNumber));
StartActivity(callIntent);
});
callDialog.SetNegativeButton("Cancel", delegate { });
// アラートダイアログを表示し、ユーザーのレスポンスを待ちます。
callDialog.Show();
};
callHistoryButton.Click += (sender, e) =>
{
var intent = new Intent(this, typeof(CallHistoryActivity));
intent.PutStringArrayListExtra("phone_numbers", phoneNumbers);
StartActivity(intent);
};
}
示例7: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
EditText phoneNumberText = FindViewById<EditText>(Resource.Id.PhoneNumberText);
Button translateButton = FindViewById<Button>(Resource.Id.TranslateButton);
Button callButton = FindViewById<Button>(Resource.Id.CallButton);
Button callHistoryButton = FindViewById<Button>(Resource.Id.CallHistoryButton);
callButton.Enabled = false;
string translatedNumber = string.Empty;
translateButton.Click += (object sender, EventArgs e) =>
{
translatedNumber = Phoneword.PhoneTranslator.ToNumber(phoneNumberText.Text);
if (string.IsNullOrWhiteSpace(translatedNumber))
{
callButton.Text = "Call";
callButton.Enabled = false;
}
else
{
callButton.Text = "Call " + translatedNumber;
callButton.Enabled = true;
}
};
callButton.Click += (object sender, EventArgs e) =>
{
var callDialog = new AlertDialog.Builder(this);
callDialog.SetMessage("Call " + translatedNumber + "?");
callDialog.SetNeutralButton("Call", delegate
{
//Ajoute le numéro à la liste des numéros appelés
phoneNumbers.Add(translatedNumber);
//Active le bouton
callHistoryButton.Enabled = true;
//Crée un Intent pour lancer un appel
var callIntent = new Intent(Intent.ActionCall);
callIntent.SetData(Android.Net.Uri.Parse("tel:" + translatedNumber));
StartActivity(callIntent);
});
callDialog.SetNegativeButton("Cancel", delegate { });
callDialog.Show();
};
callHistoryButton.Click += (object sender, EventArgs e) =>
{
var intent = new Intent(this, typeof(CallHistoryActivity));
intent.PutStringArrayListExtra("phone_numbers", phoneNumbers);
StartActivity(intent);
};
}
示例8: OnListItemClick
protected override void OnListItemClick(ListView l, View v, int position, long id)
{
base.OnListItemClick(l, v, position, id);
List<string> recieved = new List<string>();
List<string> data = new List<string>();
List<string> queryText = new List<string>();
queryText.Add(contentDate[position].Split(',').First());
Core myCore = new Core(persistentData);
data.Add("09");
data.Add(postID[position]);
recieved = myCore.messageHandler(data);
postID.Add(postID[position]);
Intent myIntent = new Intent(this, typeof(ViewPostDetail));
myIntent.PutStringArrayListExtra("replies list", recieved);
myIntent.PutStringArrayListExtra("persistent data", persistentData);
myIntent.PutStringArrayListExtra("post id", postID);
myIntent.PutStringArrayListExtra("query text", queryText);
StartActivity(myIntent);
}
示例9: OnCreate
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.drukujRaport);
// Create your application here
var dataPoczatekButton = FindViewById<Button>(Resource.Id.dataPoczatekButton);
dataPoczatekText = FindViewById<TextView>(Resource.Id.dataPoczatkowaText);
var dataKoniecButton = FindViewById<Button>(Resource.Id.dataKoniecButton);
dataKoniecText = FindViewById<TextView>(Resource.Id.dataKoniecText);
var drukujButton = FindViewById<Button>(Resource.Id.drukujButton);
var raportErrorText = FindViewById<TextView>(Resource.Id.reportErrorText);
dataPoczatekText.Text = date[0].ToShortDateString();
dataKoniecText.Text = date[1].ToShortDateString();
var kategoriaSpinner = FindViewById<Spinner>(Resource.Id.kategoriaRaportSpinner);
var data = PortfelBazaDanych.PobierzKategorie().ToArray();
var adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, data);
adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
kategoriaSpinner.Adapter = adapter;
dataPoczatekButton.Click += (sender, args) =>
{
raportErrorText.Text = "";
ShowDialog(0);
};
dataKoniecButton.Click += (sender, args) =>
{
ShowDialog(1);
};
drukujButton.Click += (sender, e) =>
{
raportErrorText.Text = "";
if (DateTime.Compare(date[1], date[0]) < 0)
{
raportErrorText.Text = "Data poczatkowa musi byæ wczeœniej ni¿ data koñcowa";
return;
}
if (DateTime.Compare(DateTime.Now, date[0]) < 0 || DateTime.Compare(DateTime.Now, date[1]) < 0)
{
raportErrorText.Text = "Daty nie moga byæ przysz³e";
return;
}
var wydatki = PortfelBazaDanych.PobierzWydatki(date[0], date[1], (string)kategoriaSpinner.SelectedItem);
var raport = RaportBuilder.ZbudujRaport(wydatki);
var intent = new Intent(this, typeof(RaportActivity));
intent.PutStringArrayListExtra("wydatki", raport as IList<string>);
StartActivity(intent);
};
}
示例10: replyQueryMessage
private void replyQueryMessage(string message)
{
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.SetTitle(message);
alert.SetPositiveButton("Ok", (senderAlert, args) =>
{
Intent intent = new Intent(this, typeof(ForumActivity));
intent.PutStringArrayListExtra("persistent data", persistentData);
StartActivity(intent);
});
RunOnUiThread(() =>
{
alert.Show();
});
}
示例11: OnCreate
/*
* setting for looping through words
* setting for language of words (later)
* setting for difficultly/level of words (by grade maybe?)
* setting for length of words
*/
protected override void OnCreate (Bundle bundle)
{
// TODO: rotating the screen restarts the app!
base.OnCreate (bundle);
Window.SetBackgroundDrawable (Resources.GetDrawable (Resource.Color.wordswipe_background));
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.ViewManager);
// set the splash screen to visible first (default)
SetActionBar (FindViewById<Toolbar> (Resource.Id.toolbar));
ActionBar.SetHomeButtonEnabled (true);
// get the TextViews from the UI
currentWordView = FindViewById<TextView> (Resource.Id.currentWord);
currentDefinitionView = FindViewById<TextView> (Resource.Id.definition);
swipeYesView = FindViewById<TextView> (Resource.Id.swipeYes);
swipeNoView = FindViewById<TextView> (Resource.Id.swipeNo);
viewWordsButton = FindViewById<Button> (Resource.Id.viewWordsButton);
generator = new WordGenerator (Assets.Open, GetFileStreamPath ("dict.txt").AbsolutePath);
InitializeWordSet ();
//FIXME: need to store this so it doesn't reset each time the user restarts the app
List<string> learnedWords = new List<string> ();
swipeYesView.Click += delegate {
UpdateCurrentWord ();
};
swipeNoView.Click += delegate {
learnedWords.Add (currentWord);
UpdateCurrentWord ();
};
viewWordsButton.Click += (sender, e) =>
{
var intent = new Intent(this, typeof(WordsLearnedActivity));
intent.PutStringArrayListExtra("learned_words", learnedWords);
StartActivity(intent);
};
}
示例12: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate (bundle);
JsonServiceClient client = new JsonServiceClient ("http://techstacks.io/");
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button> (Resource.Id.myButton);
button.Click += delegate {
var auth = new ServiceStackAuthenticator("http://techstacks.io","twitter",(jsonServiceClient) => {
//Custom get user details function, usually your user profile/session info exposed via a ServiceStack Service.
//The provided jsonServiceClient is authenticated, so can call auth services to get user details directly.
//'Account' also has a Dictionary<string,string> for user details values if required, these are then available in 'Completed'.
var userSessionInfo = jsonServiceClient.Get<UserSessionInfo>("/my-session");
return new Account(userSessionInfo.UserName,jsonServiceClient.CookieContainer);
});
StartActivity(auth.GetUI(this));
auth.Completed += (sender, eventArgs) => {
if(eventArgs.IsAuthenticated) {
GetUserFeedResponse response = null;
try {
//Grab auth cookies for app JsonServiceClient
client.CookieContainer = eventArgs.Account.Cookies;
response = client.Get(new GetUserFeed());
var intent = new Intent(this, typeof(UserFeed));
intent.PutStringArrayListExtra("techstackfeed", response.Results.Select(x => x.Name).ToList());
StartActivity(intent);
} catch(Exception) {
//Failed to get user feed.
//Show error message.
}
}
};
};
}
示例13: OnProjectSelected
private void OnProjectSelected (object sender, EventArgs e)
{
if (viewModel.Model == null) {
return;
}
var intent = new Intent (Activity, typeof (ProjectListActivity));
intent.PutStringArrayListExtra (ProjectListActivity.ExtraTimeEntriesIds, TimeEntryIds);
StartActivity (intent);
}
示例14: HandleTimeEntryClick
private void HandleTimeEntryClick (TimeEntryData timeEntry)
{
var intent = new Intent (Activity, typeof (EditTimeEntryActivity));
intent.PutStringArrayListExtra (EditTimeEntryActivity.ExtraGroupedTimeEntriesGuids, new List<string> {timeEntry.Id.ToString()});
StartActivity (intent);
}
示例15: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
EditText phoneNumberText = this.FindViewById<EditText>(Resource.Id.PhoneNumberText);
Button translateButton = this.FindViewById<Button>(Resource.Id.TranslateButton);
Button callButton = this.FindViewById<Button>(Resource.Id.CallButton);
Button callHistoryButton = this.FindViewById<Button>(Resource.Id.CallHistoryButton);
// Disable the "Call" button
callButton.Enabled = false;
// Add code to translate number
string translatedNumber = string.Empty;
translateButton.Click += (object sender, EventArgs e) =>
{
// Translate user's alphanumeric phone number to numeric
translatedNumber = PhoneTranslator.toNumber(phoneNumberText.Text);
if (String.IsNullOrWhiteSpace(translatedNumber))
{
callButton.Text = "Call";
callButton.Enabled = false;
}
else
{
callButton.Text = "Call " + translatedNumber;
callButton.Enabled = true;
}
};
callButton.Click += (object sender, EventArgs e) =>
{
// On "Call" button click, try to dial phone number.
var callDialog = new AlertDialog.Builder(this);
callDialog.SetMessage("Call " + translatedNumber + "?");
callDialog.SetNeutralButton("Call", delegate
{
phoneNumbers.Add(translatedNumber);
callHistoryButton.Enabled = true;
// Create intent to dial phone
var callIntent = new Intent(Intent.ActionCall);
callIntent.SetData(Android.Net.Uri.Parse("tel:" + translatedNumber));
StartActivity(callIntent);
});
callDialog.SetNegativeButton("Cancel", delegate { });
// Show the alert dialog to the user and wait for response.
callDialog.Show();
};
callHistoryButton.Click += (object sender, EventArgs e) =>
{
Toast t = Toast.MakeText(this, "Hola amigo", ToastLength.Long);
t.Show();
var intent = new Intent(this, typeof(CallHistoryActivity));
intent.PutStringArrayListExtra("phone_numbers", phoneNumbers);
StartActivity(intent);
//coomentario para anatole mattei
};
}