Class SearchItemContract<Item extends java.io.Serializable>

  • Type Parameters:
    Item - the type of item to edit

    public class SearchItemContract<Item extends java.io.Serializable>
    extends androidx.activity.result.contract.ActivityResultContract<android.content.Intent,​android.util.Pair<java.lang.String,​Item>>
    The EditItemContract class is a contract that handles the communication between the EditItemActivity and the EditItemAdapter.
    • 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, android.content.Intent intent)
      createIntent creates the intent for the EditItemActivity
      android.util.Pair<java.lang.String,​Item> parseResult​(int i, android.content.Intent intent)
      parseResult parses the result from the EditItemActivity
      • 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

      • SearchItemContract

        public SearchItemContract()
    • Method Detail

      • createIntent

        public android.content.Intent createIntent​(@NonNull
                                                   android.content.Context context,
                                                   android.content.Intent intent)
        createIntent creates the intent for the EditItemActivity
        Specified by:
        createIntent in class androidx.activity.result.contract.ActivityResultContract<android.content.Intent,​android.util.Pair<java.lang.String,​Item extends java.io.Serializable>>
        Parameters:
        context - the context of the activity
        intent - the intent to edit
        Returns:
        the intent
      • parseResult

        public android.util.Pair<java.lang.String,​Item> parseResult​(int i,
                                                                          @Nullable
                                                                          android.content.Intent intent)
        parseResult parses the result from the EditItemActivity
        Specified by:
        parseResult in class androidx.activity.result.contract.ActivityResultContract<android.content.Intent,​android.util.Pair<java.lang.String,​Item extends java.io.Serializable>>
        Parameters:
        i - the result code
        intent - the intent
        Returns:
        the result