[TUT] Sending a Tweet

Implemented this myself so thought I would share.
This isn’t the prettiest solution but it gives you all the facts and is nice an quick.
I’ve kept it all in one Activity to try and give you the overview you can deal with the OO later yourself.

Source file downloads are at the bottom of this post.

Ok What we are going to do:

Authorise your app to use a users twitter account.
Send a tweet from this account.


User presses Login Button
Checks if user has logged in before
Twitter webpage is opened
User logins in to twitter
App is then allowed to post tweets
Users presses Tweet Button
Tweet is sent to Twitter

A sneak preview of what it’ll look like:


You need to create a Twitter Application (takes 2 mins) on the Twitter site: https://dev.twitter.com/apps/

Just like this :
twitter create settings

Application Type: Browser
Permissions: Read & Write
Callback URL; doesnt matter put anything http://google.com

Next you need the Twitter4j Jar, this does all the hard work behind the scenes.

You can download it here: Twitter4J jar

Unzip it.
You then have to add it to your project.

Right Click on your project > Properties > Java Build Path > Add External Jars > twitter4j-core-android-2.2.3.jar> OK


Ok now to the coding!

First your manifest needs to be able to receive the twitter call back from the browser, it also needs the activity to be single instance:

<?xml version="1.0" encoding="utf-8"?>
                android:minSdkVersion="4" />
        <!-- used by twitter integration -->
                android:name="android.permission.INTERNET" />
                                <action android:name="android.intent.action.MAIN" />
                                <category android:name="android.intent.category.LAUNCHER" />
                                <action android:name="android.intent.action.VIEW" />
                                <category android:name="android.intent.category.DEFAULT" />
                                <category android:name="android.intent.category.BROWSABLE" />
                                <data android:scheme="tweet-to-twitter-blundell-01-android" />

Then I’ve compacted it all into a single Activity with comments so you should be able to understand what is going on:

package com.blundell.tut.ttt;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.Toast;
public class TweetToTwitterActivity extends Activity {
        private static final String TAG = "Blundell.TweetToTwitterActivity";
        /** Name to store the users access token */
        private static final String PREF_ACCESS_TOKEN = "accessToken";
        /** Name to store the users access token secret */
        private static final String PREF_ACCESS_TOKEN_SECRET = "accessTokenSecret";
        /** Consumer Key generated when you registered your app at https://dev.twitter.com/apps/ */
        private static final String CONSUMER_KEY = "yourConsumerKey";
        /** Consumer Secret generated when you registered your app at https://dev.twitter.com/apps/  */
        private static final String CONSUMER_SECRET = "yourConsumerSecret"; // XXX Encode in your app
        /** The url that Twitter will redirect to after a user log's in - this will be picked up by your app manifest and redirected into this activity */
        private static final String CALLBACK_URL = "tweet-to-twitter-blundell-01-android:///";
        /** Preferences to store a logged in users credentials */
        private SharedPreferences mPrefs;
        /** Twitter4j object */
        private Twitter mTwitter;
        /** The request token signifies the unique ID of the request you are sending to twitter  */
        private RequestToken mReqToken;
        private Button mLoginButton;
        private Button mTweetButton;
        /** Called when the activity is first created. */
        public void onCreate(Bundle savedInstanceState) {
                Log.i(TAG, "Loading TweetToTwitterActivity");
                // Create a new shared preference object to remember if the user has
                // already given us permission
                mPrefs = getSharedPreferences("twitterPrefs", MODE_PRIVATE);
                Log.i(TAG, "Got Preferences");
                // Load the twitter4j helper
                mTwitter = new TwitterFactory().getInstance();
                Log.i(TAG, "Got Twitter4j");
                // Tell twitter4j that we want to use it with our app
                mTwitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
                Log.i(TAG, "Inflated Twitter4j");
                mLoginButton = (Button) findViewById(R.id.login_button);
                mTweetButton = (Button) findViewById(R.id.tweet_button);
         * Button clickables are declared in XML as this projects min SDK is 1.6</br> </br>
         * Checks if the user has given this app permission to use twitter
         * before</br> If so login and enable tweeting</br>
         * Otherwise redirect to Twitter for permission
         * @param v the clicked button
        public void buttonLogin(View v) {
                Log.i(TAG, "Login Pressed");
                if (mPrefs.contains(PREF_ACCESS_TOKEN)) {
                        Log.i(TAG, "Repeat User");
                } else {
                        Log.i(TAG, "New User");
         * Button clickables are declared in XML as this projects min SDK is 1.6</br> </br>
         * @param v the clicked button
        public void buttonTweet(View v) {
                Log.i(TAG, "Tweet Pressed");
         * Create a request that is sent to Twitter asking 'can our app have permission to use Twitter for this user'</br>
         * We are given back the {@link mReqToken}
         * that is a unique indetifier to this request</br>
         * The browser then pops up on the twitter website and the user logins in ( we never see this informaton
         * )</br> Twitter then redirects us to {@link CALLBACK_URL} if the login was a success</br>
        private void loginNewUser() {
                try {
                        Log.i(TAG, "Request App Authentication");
                        mReqToken = mTwitter.getOAuthRequestToken(CALLBACK_URL);
                        Log.i(TAG, "Starting Webview to login to twitter");
                        WebView twitterSite = new WebView(this);
                } catch (TwitterException e) {
                        Toast.makeText(this, "Twitter Login error, try again later", Toast.LENGTH_SHORT).show();
         * The user had previously given our app permission to use Twitter</br>
         * Therefore we retrieve these credentials and fill out the Twitter4j helper
        private void loginAuthorisedUser() {
                String token = mPrefs.getString(PREF_ACCESS_TOKEN, null);
                String secret = mPrefs.getString(PREF_ACCESS_TOKEN_SECRET, null);
                // Create the twitter access token from the credentials we got previously
                AccessToken at = new AccessToken(token, secret);
                Toast.makeText(this, "Welcome back", Toast.LENGTH_SHORT).show();
         * Catch when Twitter redirects back to our {@link CALLBACK_URL}</br>
         * We use onNewIntent as in our manifest we have singleInstance="true" if we did not the
         * getOAuthAccessToken() call would fail
        protected void onNewIntent(Intent intent) {
                Log.i(TAG, "New Intent Arrived");
        protected void onResume() {
                Log.i(TAG, "Arrived at onResume");
         * Twitter has sent us back into our app</br>
         * Within the intent it set back we have a 'key' we can use to authenticate the user
         * @param intent
        private void dealWithTwitterResponse(Intent intent) {
                Uri uri = intent.getData();
                if (uri != null && uri.toString().startsWith(CALLBACK_URL)) { // If the user has just logged in
                        String oauthVerifier = uri.getQueryParameter("oauth_verifier");
         * Create an access token for this new user</br>
         * Fill out the Twitter4j helper</br>
         * And save these credentials so we can log the user straight in next time
         * @param oauthVerifier
        private void authoriseNewUser(String oauthVerifier) {
                try {
                        AccessToken at = mTwitter.getOAuthAccessToken(mReqToken, oauthVerifier);
                        // Set the content view back after we changed to a webview
                } catch (TwitterException e) {
                        Toast.makeText(this, "Twitter auth error x01, try again later", Toast.LENGTH_SHORT).show();
         * Allow the user to Tweet
        private void enableTweetButton() {
                Log.i(TAG, "User logged in - allowing to tweet");
         * Send a tweet on your timeline, with a Toast msg for success or failure
        private void tweetMessage() {
                try {
                        mTwitter.updateStatus("Test - Tweeting with @Blundell_apps #AndroidDev Tutorial using #Twitter4j http://blog.blundellapps.co.uk/sending-a-tweet");
                        Toast.makeText(this, "Tweet Successful!", Toast.LENGTH_SHORT).show();
                } catch (TwitterException e) {
                        Toast.makeText(this, "Tweet error, try again later", Toast.LENGTH_SHORT).show();
        private void saveAccessToken(AccessToken at) {
                String token = at.getToken();
                String secret = at.getTokenSecret();
                Editor editor = mPrefs.edit();
                editor.putString(PREF_ACCESS_TOKEN, token);
                editor.putString(PREF_ACCESS_TOKEN_SECRET, secret);

If you find this helpful please say thanks πŸ™‚ Happy Coding

And any questions just ask!

The eclipse project src as promised:

—> TweetToTwitter <---

101 thoughts on “[TUT] Sending a Tweet

  1. I am getting “Twitter Login error, try again later”. In my case it’s giving me problem in this line.
    mReqToken = mTwitter.getOAuthRequestToken(CALLBACK_URL);

    It’s crashing from here. it directly goes to catch didn’t even execute the webview part. I found this may be because of wrong time in device. But I double checked that’s not a problem. Cay any one guide me what could be issue behind this?

    Thanks in advance.

  2. HI ! I’ve followed your code, and it works! But i have a problem: I want that after the Twitter name/passw step,instead of returning to the mainActivity, I need to go to another Activity…how can I do that?
    Thanks in advance!

  3. Thank you for the insight and excellent commenting on the code to a very confusing task. My question is about what happens when you sign-in to your twitter account for the first time. It takes me to the Authorize page and I hit sign in but it doesn’t do anything after that. If I hit cancel it takes me back to the app as it’s supposed to but I can’t seem to authorize as needed. Also when I first tried to run this I had to create a new thread in order to run mTwitter.getOAuthRequestToken(CALLBACK_URL); because it said you couldn’t run this on main thread. Thank you for your time

  4. hi frnd,

    i use your code in my application and it works successfully till the login process. and now the problem is that after successfull login the code which i written in newIntent() method is not working…. why this happen pls help me..

  5. I have a problem with the application open the page of twitter but when I put the user and password do not direct to the application, Instead direction to the callback_url and the application does nothing more.

    1. Hi a solve this problem I just erase “Callback URL” in twitter developers. Now I have the problem whit a PIN code. anybody have an idea.

  6. ok now i debugged and found the problem.
    it’s twitter api v1 cause i gives this error:
    “The Twitter REST API v1 is no longer active”

    How can i switch to twitter API v1.1?

  7. Hi,
    I’ve found your example a couple months ago, i entegreted it with my app nad it has been working perfectly till now.
    I havent changed anything.But when i click tweet button it throws exeption at this part:
    private void tweetMessage() {
    try {
    //mTwitter.updateStatus(“Test2 – #AndroidDev”);
    Toast.makeText(this, “Tweeted Successfully!”, Toast.LENGTH_SHORT).show();

    } catch (TwitterException e) {
    Toast.makeText(this, “Tweet error, try again later.”, Toast.LENGTH_SHORT).show(); }
    I donwloaded your project again and it’s gave the same error.I created a new app and user but it doesnt work.
    What should i do?
    Is it because twitter api v.1.1 or something?

    Please help.Thank you

  8. Hello,i have question i’ve tried implementing your code imported it like a project from existing code, thelogin seems to work but when i come back from the authentication ,the tweet button is not enabled, might you know what could be the problem or maybe i am doing something wrong? Thanks in advance.

  9. Hello,
    Program working brilliantly, posted to Twitter first time, please can you tell me how I can incorporate this into my existing application? Is there a class that you can create from this app that I can call from my main app?


  10. Hi thanks for tutorials, I am new to android, I have tried your code but it showing me problem with login, it is showing me toast at line 116.

    Could you please help me to solve this it’s very urgent.

  11. Hi, i changed consumer key and consumer secrete key but i am still getting error in your project. and error is –
    java.lang.VerifyError: com.blundell.tut.ttt.TweetToTwitterActivity
    where as i have put all keys correctly. and also check for second project but getting same error. so please tell me what the problem is exactly.
    and i also don’t find field application type(client , browser) on dev.twitter.com web site. so please help.

  12. I have followed the procedure completely, included all the libraries. Still i am getting this error:
    01-04 11:48:58.016: E/dalvikvm(328): Could not find class ‘twitter4j.http.AccessToken’, referenced from method com.ecs.android.sample.twitter.TwitterUtils.isAuthenticated
    01-04 11:48:58.067: E/AndroidRuntime(328): java.lang.NoClassDefFoundError: twitter4j.http.AccessToken
    01-04 11:48:58.067: E/AndroidRuntime(328): at com.ecs.android.sample.twitter.TwitterUtils.isAuthenticated(TwitterUtils.java:18)
    01-04 11:48:58.067: E/AndroidRuntime(328): at com.ecs.android.sample.twitter.AndroidTwitterSample.updateLoginStatus(AndroidTwitterSample.java:72)
    01-04 11:48:58.067: E/AndroidRuntime(328): at com.ecs.android.sample.twitter.AndroidTwitterSample.onResume(AndroidTwitterSample.java:68)

  13. hi I tried your sourcecode above but I got this error when I run it to my nexus s.

    10-31 18:12:15.699: E/AndroidRuntime(7881): FATAL EXCEPTION: main
    10-31 18:12:15.699: E/AndroidRuntime(7881): java.lang.VerifyError: edu/rivera/augmentwit/MainActivity
    10-31 18:12:15.699: E/AndroidRuntime(7881): at java.lang.Class.newInstanceImpl(Native Method)
    10-31 18:12:15.699: E/AndroidRuntime(7881): at java.lang.Class.newInstance(Class.java:1319)
    10-31 18:12:15.699: E/AndroidRuntime(7881): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)

    1. Hmm verify error is something like the app didn’t install correctly, or class declarations are incorrect, i.e. AndroidManifest or packages. The source code works!

  14. Dear Blundell,

    Its working fine for me.

    How can we implement whole process with help of WebView, Please explain wholw process to implement it.

  15. Dear Blundell,

    Great tutorial,
    I am able to tweet my custom tweet from above program.

    How Can it will be implement whole process with help of WebView?

  16. Hello blundell,
    Nice blog ..!!really helpful in getting started..!!
    The only issue is every time i get registered as a new user.
    so here is how it should have worked according to code,u first click on login button for the first time,then registers with twitter,then comes back to the activity,tweet button should be enabled..have i done it rightly??
    also now if i press login button i should be detected as a “repeat user” and should be able to tweet..either ways all what is happening is i am just getting registered,i am not able to go back to the screen and tweet..can u help me get it right??

  17. hey thanks for tutorial
    see i have used your code but on ics and jellybean it shows fouce close when you press login button…
    I want to develop app in which user can twitte that XYZ listening XYZ file on XYZ app..
    Also I want to show recent twits made by other member .
    can you help me
    thank you

  18. Hi Blundell, I have a really strange error, on my app, when the log in screen comes with the permissions requiered by the app, it doesn’t let me put my username or password? any idea what could it be?

  19. how can i perform the same task in the tabHost?? when i click on the sing-in button on the web browser it gives the error “android.view.WindowManager$BadTokenException: Unable to add window — token android.app.LocalActivityManager$LocalActivityRecord@40e038c0 is not valid; is your activity running?”

    in the tabhost the tweet part it in the child activity.. please help me out..!!
    Thanks in advance..!!

    1. Hi sorry I don’t have experience of using a WebView inside of a TabHost, I don’t see an immediate problem. Perhaps try it outside of the tabhost first to ensure you can get it to work with your project, then move it inside.

    1. i had the same problem. I fixed it by removing all cookies on logout.
      I eventually used this as my logout function:

      public void logout() {
      Editor editor = mPrefs.edit();

  20. why when i finished login it is not direct again to app but direct to callback url so when i finished login direct to webpage url

  21. How would you set this up using Async Task? Every time I try and log in, I get a NetworkOnMainThreadException. Is Async the thing to use here? I am having a hard time implementing it into the code though.

    1. Hi Eric,
      This tutorial uses a webview so I don’t see what networking you are doing. You must be doing something outside the tut. but yes you shouldn’t do internet calls on your UI thread, use a background thread or an ASyncTask

      1. Well, when I try and run the app on ICS, it force closes because it’s running in the main thread. So I try and use Async Task, but it won’t let me set up the WebView for some reason..

        1. ditto to that problem πŸ™‚ should take off the main thread for ICS – awesome tutorial blundell! Thanks for being a legend and commenting

          1. Yes, I totally agree with Silke: Commenting in sample Java apps, especially for Android, is so rare. Proper commenting can make soooo much difference to the readability of code, not just for others, but for your own maintenance later, when you’re trying to work out why you wrote the code that way in the first place!

            Well done Blundell!

  22. Hi, thanks for sharing. I’m trying to adapt this to an app where the Twitter portion is in it’s own Intent/Activity.

    As is, I’m getting a VerifyError exception, it seems to be failing (as noted in the article) on the OAuthAccessToken call. I’m not sure exactly how to fix this (kind of a noob here). Obviously I’ll need to do some doctoring on my manifest, but that’s a bit beyond me at the moment.

    Here’s what LogCat has to say:

    06-11 01:43:20.975: I/dalvikvm(5985): Could not find method twitter4j.Twitter.getOAuthAccessToken, referenced from method ***.IntegrateTwitter.authoriseNewUser
    06-11 01:43:20.975: W/dalvikvm(5985): VFY: unable to resolve interface method 359: Ltwitter4j/Twitter;.getOAuthAccessToken (Ltwitter4j/auth/RequestToken;Ljava/lang/String;)Ltwitter4j/auth/AccessToken;
    06-11 01:43:20.990: W/dalvikvm(5985): VFY: unable to resolve exception class 144 (Ltwitter4j/TwitterException;)
    06-11 01:43:20.990: W/dalvikvm(5985): VFY:  rejected L***/IntegrateTwitter;.authoriseNewUser (Ljava/lang/String;)V
    06-11 01:43:20.990: W/dalvikvm(5985): VFY:  rejected L***/IntegrateTwitter;.authoriseNewUser (Ljava/lang/String;)V
    06-11 01:43:20.990: W/dalvikvm(5985): Verifier rejected class L***/IntegrateTwitter;
    06-11 01:43:20.990: W/dalvikvm(5985): Class init failed in newInstance call (L***/IntegrateTwitter;)
    06-11 01:43:20.990: E/AndroidRuntime(5985): java.lang.VerifyError: ***.IntegrateTwitter

    Could you give me any hints or a direction to go with debugging? Thanks again.

    1. Ooo not too sure about this error, make sure your using the same twitter4j.jar that the tutorial uses, ensure it is added to your manifest correctly. It seems it’s something to do with twitter4j itself

    2. Hello Matt,

      I am getting the similar error

      Could not find method twitter4j.Twitter.getOAuthAccessToken,

      How did you solve the problem?


      1. I’ve since heavily modified this example, so I’m not entirely sure, but as I recall, one of my problems was that the twitter4j library was not being used as a library properly.

        Go to your project properties -> Java Build Path -> Order and Export tab, and ensure the box next to the twitter4j JAR is checked.

  23. Your code works (Thanks btw) but when I get to the twitter login web view it doesn’t display the keyboard when I click. I’m pretty sure it has nothing to do with your stuff but, any suggestions what can it be??

    1. Thanks, well done! Hmm I’ve seen issue’s like this before, if you open it in a webview there are a couple of things you can do with enabling javascript (check stackoverflow), but if it is just opening the browser sorry the keyboard opening will just phone dependant. πŸ™

        1. @mainder, how you fix the code?

          I tried, but still the keyboard doesn’t show up..

          can you share your code?

          1. private void loginNewUser() {
            try {
            Log.i(TAG, “Request App Authentication”);
            mReqToken = mTwitter.getOAuthRequestToken(CALLBACK_URL);

            Log.i(TAG, “Starting Webview to login to twitter”);
            WebView twitterSite = new WebView(this);
            twitterSite.setOnTouchListener(new View.OnTouchListener() {
            public boolean onTouch(View v, MotionEvent event) {
            switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_UP:
            if (!v.hasFocus()) {
            return false;

            } catch (TwitterException e) {
            Toast.makeText(this, “Twitter Login error, try again later”,


  24. Thanks for this, been trying to write a Android Twitter App and kept getting java.lang.NoClassDefFoundError: twitter4j.TwitterFactory

    I compared you code with mine and couldn’t see anything I was doing wrong and i’d imported the twitter4j libraries correctly. I did notice that you were using version 2.2.3-1 and I was using 2.2.5 so I swapped to 2.2.3-1 and found my code was now working ok.
    So just wondering if you had come across the same problem given that as far as I can tell 2.2.5 was already out when you wrote this tutorial?

    1. Interesting, no I didn’t come across it, I don’t think 2.2.5 was out when I wrote this but if it was I was just lucky and had the older version downloaded!

  25. Hi blundell..I done as step as you write above.But it also as weeber error : “Twitter Login error, try again later”..I look logcat and display error: 401: authentication credential..:(..Do you know how to fix that error.

    1. You need to ensure the clock on your Emulator/Phone is set to the correct time, to allow Twitter oAuth to work

    2. Correct time is what?I run in my phone
      and my device set time as time in my computer.I tried with your tutorial but it alway display 401..I also think cause is not correct time but I don’t know synchronize with twitter time.Do you help me.

  26. Thanks for the the code it really helped me a lot. One question, how to share url link besided message and image in one tweet?

    1. Looking at the API I can’t see a way to attach pictures. I assume you just attach the URL (like in the tutorial) and twitter will parse it for an image if it has one.

  27. I have imported your project in eclipse, added the necessary consumer key info and ran the app, but I get an error on the callback. it says that the website is not found for the callback url? I haven’t changed anything else…

    1. You may have missed something, have you added your consumer secret as well, and the callback URL in your manifest matches your class?

  28. i tried running but cant continue to tweet since i cant login into twitter(the part where it needs my authentication). am i the only one here who got this kind of error? please help!

    1. Yes Anthony you are πŸ™‚ When people successfully tweet, it tweets at me an I get them all the time! Have you got your intents correctly declared in your manifest?

  29. Blundell,
    Thank you for such a nice piece of work. Most of the content I have found online is over complicated without a proper justification.
    Keep up the tutorials.

  30. Thanks for the tutorial. However in my code in the dealWithTwitterResponse method the uri from the line uri = this.getIntent().getData() turns up null. Any idea why?

  31. I think dealWithTwitterResponse should also handle case where users don’t go forward with login (cancel and return return to app). In this case, the uri returned wont have parameter “oauth_verifier” and the app will crash.

  32. In the authorizeNewUser method at mTwitter.getOAuthAccessToken(mReqToken, oauthVerifier) the app is returning an exception.

    mReqToken seems to be null.

    Any thoughts on this?

  33. Hello thanks for example. I downloaded your project and tried to run that. I changed only consumer key and secret. but it doesn not work. When i press login, toast appears and says “Twitter Login error, try again later” . What did I do wrong?

    1. Hi Mert,
      You’ll have to debug it, does the LogCat throw any exceptions? Did you have internet connection? Did you sign up to twitter correctly? Perhaps post a question on stackoverflow it has a nice Q&A design

      1. 03-19 10:01:47.806: I/Blundell.TweetToTwitterActivity(197): Login Pressed
        03-19 10:01:47.806: I/Blundell.TweetToTwitterActivity(197): New User
        03-19 10:01:47.806: I/Blundell.TweetToTwitterActivity(197): Request App Authentication
        03-19 10:01:48.744: D/dalvikvm(197): GC freed 6812 objects / 395744 bytes in 69ms
        03-19 10:01:48.844: I/global(197): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
        03-19 10:01:48.844: I/NotificationService(52): enqueueToast pkg=com.blundell.tut.ttt callback=android.app.ITransientNotification$Stub$Proxy@44dbca90 duration=0

        when i press login , see theese on logcat

          1. Hi blundell, I am getting the same error as described above.
            I used your code, added my consumer key and consumer secret. My callback URL is “” (on the twitter app site and in the code) (not sure if this is an issue).

            log cat indicates:
            08-31 22:41:06.900: Arrived at onResume
            08-31 22:41:11.235: Login Pressed
            08-31 22:41:11.240: New User
            08-31 22:41:11.240: Request App Authentication

            I’m quite new to this and am stumped.

  34. Hi blundell, does this code work for you when connected to a 3G/data connection? This and any other twitter4j examples I’ve tried only work on wifi for some reason :/

    1. Yes it should do I can’t see why not. It must be a device issue, or maybe when you create your APK it’s getting pro-guarded and that is removing the twitter4j jar? (random guess).

  35. “Twitter Login error, try again later”

    The login is failing, I’m running the same code you posted, I just changed the CONSUMER_KEY and CONSUMER_SECRET to use my keys. The webview never shows up.

    1. You may have missed some code, as it works for many others. Have you checked your manifest? What else does the LogCat say?

  36. I would like to thank you for the sample code . It was really helpful. I created some addition methods to pass the mTwitter across the application but I am getting error in the setTwitter method. I have no idea why it is giving error. Please sujjest . I have pasted the code here http://pastebin.com/PKJcaSpJ

Leave a Reply

Your email address will not be published. Required fields are marked *