相关疑难解决方法(0)

在android中调用Intent.ACTION_VIEW之后返回

我的应用程序有3个活动A,B,C.活动A调用B.在B中,我调用Intent.ACTION_VIEW对Twitter进行身份验证,如下所示:

public static void DoAuthen(Context context, String CallBackUrl) throws OAuthMessageSignerException, OAuthNotAuthorizedException,
        OAuthExpectationFailedException, OAuthCommunicationException {
    httpOauthConsumer = new CommonsHttpOAuthConsumer(context.getString(R.string.Twitter_ConsumerKey), context
            .getString(R.string.Twitter_ConsumerSecret));
    httpOauthprovider = new DefaultOAuthProvider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token",
            "http://twitter.com/oauth/authorize");
    String authUrl = httpOauthprovider.retrieveRequestToken(httpOauthConsumer, CallBackUrl);
    context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
}
Run Code Online (Sandbox Code Playgroud)

验证后,我的应用程序在活动B回调.这里B调用C.现在,如果我按下返回按钮,它将导航到浏览器(以前用于通过Twitter进行身份验证),而不是B,然后是A.我怎么能解决这个?

android android-intent twitter4j twitter-oauth

5
推荐指数
1
解决办法
7039
查看次数