Skip to content

Commit

Permalink
Update to use ComponentActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahkoop committed Jan 5, 2024
1 parent b2b62d1 commit def3f99
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Venmo/src/main/java/com/braintreepayments/api/VenmoLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwner;

/**
Expand All @@ -25,7 +24,7 @@ public class VenmoLauncher {

/**
* Used to launch the Venmo authentication flow to tokenize a Venmo account. This class must be
* instantiated in the OnCreate method of your Fragment.
* instantiated before the Fragment is created.
*
* @param fragment an Android Fragment from which you will launch the Venmo app
* @param callback a {@link VenmoLauncherCallback} to receive the result of the Venmo
Expand All @@ -39,13 +38,13 @@ public VenmoLauncher(@NonNull Fragment fragment,

/**
* Used to launch the Venmo authentication flow to tokenize a Venmo account. This class must be
* instantiated in the OnCreate method of your Activity.
* instantiated before the Activity is created.
*
* @param activity an Android Activity from which you will launch the Venmo app
* @param callback a {@link VenmoLauncherCallback} to receive the result of the Venmo
* app switch authentication flow
*/
public VenmoLauncher(@NonNull FragmentActivity activity,
public VenmoLauncher(@NonNull ComponentActivity activity,
@NonNull VenmoLauncherCallback callback) {
this(activity.getActivityResultRegistry(), activity, callback);
}
Expand All @@ -58,7 +57,9 @@ public VenmoLauncher(@NonNull FragmentActivity activity,
}

/**
* Launches the Venmo authentication flow by switching to the Venmo app.
* Launches the Venmo authentication flow by switching to the Venmo app. This method cannot be
* called until the lifecycle of the Fragment or Activity used to instantiate your
* {@link VenmoLauncher} has reached the CREATED state.
*
* @param venmoPaymentAuthRequest the result of
* {@link VenmoClient#createPaymentAuthRequest(android.content.Context, VenmoRequest, VenmoPaymentAuthRequestCallback)}
Expand Down

0 comments on commit def3f99

Please sign in to comment.