File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
package com .codepath .oauth ;
2
2
3
+ import android .content .Intent ;
3
4
import android .net .Uri ;
4
- import android .os .Bundle ;
5
5
import android .support .v4 .app .FragmentActivity ;
6
6
7
7
import com .codepath .utils .GenericsUtil ;
@@ -11,12 +11,21 @@ public abstract class OAuthLoginActivity<T extends OAuthBaseClient> extends Frag
11
11
implements OAuthBaseClient .OAuthAccessHandler {
12
12
13
13
private T client ;
14
-
14
+
15
+ // Use this to properly assign the new intent with callback code
16
+ // for activities with a "singleTask" launch mode
17
+ @ Override
18
+ protected void onNewIntent (Intent intent ) {
19
+ super .onNewIntent (intent );
20
+ setIntent (intent );
21
+ }
22
+
23
+ // Extract the uri data and call authorize to retrieve access token
24
+ // This is why after the browser redirects to the app, authentication is completed
15
25
@ SuppressWarnings ("unchecked" )
16
26
@ Override
17
- protected void onCreate (Bundle saved ) {
18
- super .onCreate (saved );
19
-
27
+ protected void onResume () {
28
+ super .onResume ();
20
29
Class <T > clientClass = getClientClass ();
21
30
// Extracts the authenticated url data after the user
22
31
// authorizes the OAuth app in the browser
You can’t perform that action at this time.
0 commit comments