Inheritance: Android.Support.V4.App.Fragment
        // Static factory method that creates and initializes a new flash card fragment:
        public static FlashCardFragment newInstance(String question, String answer)
        {
            // Instantiate the fragment class:
            FlashCardFragment fragment = new FlashCardFragment();

            // Pass the question and answer to the fragment:
            Bundle args = new Bundle();
            args.PutString(FLASH_CARD_QUESTION, question);
            args.PutString(FLASH_CARD_ANSWER, answer);
            fragment.Arguments = args;

            return fragment;
        }
        // Static factory method that creates and initializes a new flash card fragment:
        public static FlashCardFragment newInstance(String question, String answer)
        {
            // Instantiate the fragment class:
            FlashCardFragment fragment = new FlashCardFragment();

            // Pass the question and answer to the fragment:
            Bundle args = new Bundle();

            args.PutString(FLASH_CARD_QUESTION, question);
            args.PutString(FLASH_CARD_ANSWER, answer);
            fragment.Arguments = args;

            return(fragment);
        }
Esempio n. 3
0
 // Returns a new fragment for the flash card at this position:
 public override Android.Support.V4.App.Fragment GetItem(int position)
 {
     return((Android.Support.V4.App.Fragment)
            FlashCardFragment.newInstance(flashCardDeck[position].Problem, flashCardDeck[position].Answer));
 }