Class MealPlanContract


  • public class MealPlanContract
    extends androidx.activity.result.contract.ActivityResultContract<MealPlan,​android.util.Pair<java.lang.String,​MealPlan>>
    The MealPlanContract class is the contract for the MealPlanActivity.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class androidx.activity.result.contract.ActivityResultContract

        androidx.activity.result.contract.ActivityResultContract.SynchronousResult<T extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      android.content.Intent createIntent​(android.content.Context context, MealPlan mealPlan)
      The createIntent method creates the intent to launch the meal plan activity.
      android.util.Pair<java.lang.String,​MealPlan> parseResult​(int i, android.content.Intent intent)
      The parseResult method parses the result from the meal plan activity.
      • Methods inherited from class androidx.activity.result.contract.ActivityResultContract

        getSynchronousResult
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MealPlanContract

        public MealPlanContract()
    • Method Detail

      • createIntent

        @NonNull
        public android.content.Intent createIntent​(@NonNull
                                                   android.content.Context context,
                                                   MealPlan mealPlan)
        The createIntent method creates the intent to launch the meal plan activity. It passes the meal plan to the activity.
        Specified by:
        createIntent in class androidx.activity.result.contract.ActivityResultContract<MealPlan,​android.util.Pair<java.lang.String,​MealPlan>>
        Parameters:
        context - The context.
        mealPlan - The meal plan.
        Returns:
        The intent to launch the meal plan activity.
      • parseResult

        public android.util.Pair<java.lang.String,​MealPlan> parseResult​(int i,
                                                                              @Nullable
                                                                              android.content.Intent intent)
        The parseResult method parses the result from the meal plan activity. It returns the type of result and the meal plan.
        Specified by:
        parseResult in class androidx.activity.result.contract.ActivityResultContract<MealPlan,​android.util.Pair<java.lang.String,​MealPlan>>
        Parameters:
        i - The result code.
        intent - The intent.
        Returns:
        The type of result and the meal plan.