本文整理汇总了C#中Bundle.PutStringArray方法的典型用法代码示例。如果您正苦于以下问题:C# Bundle.PutStringArray方法的具体用法?C# Bundle.PutStringArray怎么用?C# Bundle.PutStringArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bundle
的用法示例。
在下文中一共展示了Bundle.PutStringArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override View OnCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState)
{
base.OnCreateView(inflater, container, savedInstanceState);
var view = inflater.Inflate(
Resource.Layout.activity_category, container, false);
GridView gridView = (GridView)view.FindViewById(Resource.Id.grid_view);
// Instance of ImageAdapter Class
var categories = DataHandler.LoadCategoriesFromLocalDatabase(new LocalDB());
gridView.SetAdapter(new CategoryAdapter(view.Context, categories));
gridView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs args)
{
List<string> choiceList = new List<string>();
List<string> detailList = new List<string>();
var category = categories[args.Position];
var choices = categories[args.Position].Choices;
// Add each choice from selected category to list
// Add each detail from selected choice to list
foreach (var choice in choices)
{
choiceList.Add(choice.Name);
detailList.AddRange(choice.Details.Select(detail => detail.Name));
}
if (choices == null || choices.Count == 0 || String.IsNullOrEmpty(choices[0].Name))
// String.IsNullOrEmpty(choices[0].Name) = Dummy, hvis der er en tom Choice liste uden et navn
{
CallEntity callEntity = CallWrapper.WrapCall(UserData.CPRNR, CallUtil.StatusCode.Active, category);
Call.MakeCall(callEntity, Activity);
}
else
{
Bundle bundle = new Bundle();
bundle.PutStringArray("choices", choiceList.ToArray());
bundle.PutStringArray("details", detailList.ToArray());
bundle.PutString("category", categories[args.Position].Name);
Intent intent = new Intent(Application.Context, typeof(ChoiceActivity));
intent.PutExtras(bundle);
StartActivity(intent);
}
};
return view;
}
示例2: NewInstance
/// <summary>
/// Creates a new instance of ConfirmationDialogFragment.
/// </summary>
/// <returns>A new instance.</returns>
/// <param name="resources">The list of resources requested by PermissionRequeste.</param>
public static ConfirmationDialogFragment NewInstance (String[] resources)
{
var fragment = new ConfirmationDialogFragment ();
var args = new Bundle ();
args.PutStringArray (ARG_RESOURCES, resources);
fragment.Arguments = args;
return fragment;
}
示例3: OnListItemClick
void OnListItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
var choice = choiceList[e.Position];
var intent = new Intent(Application.Context, typeof(DetailChoiceActivity));
// Hvis der er ikke er nogen detailer, start kaldet her
if (choice == null || details.Count == 0)
{
CallEntity callEntity = CallWrapper.WrapCall(UserData.CPRNR, CallUtil.StatusCode.Active, category, choice);
AppDelegate.MakeCall(callEntity, choice.Name, vc);
}
Bundle bundle = new Bundle();
bundle.PutStringArray("details", detailList.ToArray());
bundle.PutString("choice", choice);
intent.PutExtras(bundle);
StartActivity(intent);
}
示例4: OnCreate
protected override void OnCreate(Bundle bundle)
{
sInstance = this;
base.OnCreate(bundle);
Game1.Activity = this;
mGame = new Game1();
SetContentView(mGame.Window);
using (var ignore = new TV.Ouya.Sdk.OuyaInputView(this))
{
// do nothing
}
View content = FindViewById (Android.Resource.Id.Content);
if (null != content) {
content.KeepScreenOn = true;
}
mGame.Run();
Bundle developerInfo = new Bundle();
developerInfo.PutString(OuyaFacade.OUYA_DEVELOPER_ID, "310a8f51-4d6e-4ae5-bda0-b93878e5f5d0");
byte[] applicationKey = null;
// load the application key from assets
try {
AssetManager assetManager = ApplicationContext.Assets;
AssetFileDescriptor afd = assetManager.OpenFd(SIGNING_KEY);
int size = 0;
if (null != afd) {
size = (int)afd.Length;
afd.Close();
using (Stream inputStream = assetManager.Open(SIGNING_KEY, Access.Buffer))
{
applicationKey = new byte[size];
inputStream.Read(applicationKey, 0, size);
inputStream.Close();
}
}
} catch (Exception e) {
Log.Error (TAG, string.Format("Failed to read application key exception={0}", e));
}
if (null != applicationKey) {
Log.Debug (TAG, "Read signing key");
developerInfo.PutByteArray (OuyaFacade.OUYA_DEVELOPER_PUBLIC_KEY, applicationKey);
} else {
Log.Error (TAG, "Failed to authorize with signing key");
Finish ();
return;
}
developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_ID, "0000000000000");
developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_KEY, "000000000000000000");
developerInfo.PutStringArray(OuyaFacade.OUYA_PRODUCT_ID_LIST, Game1.PURCHASABLES);
_ouyaFacade = OuyaFacade.Instance;
_ouyaFacade.Init(this, developerInfo);
}
示例5: ToBundle
public void ToBundle(Bundle b)
{
b.PutStringArray(Key, Value);
}
示例6: GetPlusClientFragment
// Attach a PlusClient managing fragment to you activity.
public static PlusClientFragment GetPlusClientFragment(
FragmentActivity activity, String[] visibleActivities)
{
if (!(activity is OnSignedInListener))
{
throw new ArgumentException(
"The activity must implement OnSignedInListener to receive callbacks.");
}
// Check if the fragment is already attached.
FragmentManager fragmentManager = activity.GetSupportFragmentManager();
Fragment fragment = fragmentManager.FindFragmentByTag(TAG_PLUS_CLIENT);
if (fragment is PlusClientFragment)
{
// The fragment is attached. If it has the right visible activities, return it.
if (Arrays.Equals(visibleActivities,
fragment.GetArguments().GetStringArray(ARG_VISIBLE_ACTIVITIES)))
{
return (PlusClientFragment)fragment;
}
}
FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();
// If a fragment was already attached, remove it to clean up.
if (fragment != null)
{
fragmentTransaction.Remove(fragment);
}
// Create a new fragment and attach it to the fragment manager.
Bundle arguments = new Bundle();
arguments.PutStringArray(ARG_VISIBLE_ACTIVITIES, visibleActivities);
PlusClientFragment signInFragment = new PlusClientFragment();
signInFragment.SetArguments(arguments);
fragmentTransaction.Add(signInFragment, TAG_PLUS_CLIENT);
fragmentTransaction.Commit();
return signInFragment;
}
示例7: OnSaveInstanceState
public override void OnSaveInstanceState (Bundle outState)
{
List<string> myList = mAdapter.getTrakkedShows ();
if (myList.Count != 0) {
string[] myArray = new string[myList.Count];
for (int i = 0; i < myList.Count; i++) {
myArray [i] = myList [i];
}
outState.PutStringArray ("TrakkedList", myArray);
}
Console.WriteLine ("##$$###$$### I Saved my bundle with size " + myList.Count);
}