Hi I want to connect to the google services . I am OAuth Client API to connect to it. Th redirect uri I'm using is "http://localhost"
But when I select "Allow access" then I want to start start another activity . But as soon as I press "Allow access" , then it opens the intent chooser with the following options : 1) Browser 2) Project Name
It is showing this because I have started Activity with "View" Action and declared the target activity with "BROWSABLE" category.
But when I am removing "BROWSABLE" category, then it is directly showing browser and hence the page dosn't loads.
The code I'm using is :
String authenticationUrl= "https://accounts.google.com/o/oauth2/auth?
scope=https://www.googleapis.com/"+
"auth/userinfo.email+https://www.googleapis.com/auth/userinfo."+
"profile";
OAuthClientRequest request = null;
try {
request = OAuthClientRequest
.authorizationLocation(authenticationUrl)
.setClientId(CLIENT_ID)
.setRedirectURI(REDIRECT_URI)
.buildQueryMessage();
} catch (OAuthSystemException e) {
e.printStackTrace();
}
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(request.getLocationUri() + "&response_type=code"));
startActivity(intent);
In Manifest I have declared the target activity like this :
<activity android:name=".TestActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="localhost"/>
</intent-filter>
</activity>
My issue is that I don't want to open intent chooser when user selects "Allow access" button after getting authenticated .
Please help.