开发者

Unknown host Exception while calling method " twitter.getOAuthRequestToken()"

I am trying to integrate twitter api using library twitter4j-core-2.1.1-SNAPSHOT.jar. But i am getting error Unknown host Exception from 2 days. here is the part of code(index by .....(1)) that is generating Exception.

public String beginAuthorization() {

    //showDialog("Authorization...........");
    //new AuthorizationTask(this).execute("Authorize");

    try {

        if (null == currentRequestToken) {
            Log.e("begin","i am here the line below is throwing excetion");
            currentRequestToken = twitter.getOAuthRequestToken();............(1)

        }
        Log.e("beginAuthorization", currentRequest开发者_Go百科Token.getAuthorizationURL());
        return currentRequestToken.getAuthorizationURL();

    } catch (TwitterException e) {
        e.printStackTrace();


    }

    return null;

}

anyone have idea about this problem???

thank u in advance


  1. Did you put permission in xml manifest?
  2. Have you tried opening a browser in android and going to twitter.com?
  3. Try to connect to any url from the code and see what happens.


This is what I'd forgotten to include in my AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜