Encounter Authentication error 401 while trying to update status - Android


I have been trying to create a update status function on the Android platform under the doInBackground in AsyncTask. Below are the code for the updating i am refering from http://stackoverflow.com/questions/17425692/integrate-twitter4j-v3-0-3-to-android-application-get-timeline-and-post-tweet. But everytime i try tweeting, i will always get a 401:Authentication credentials. Is there anything that i’m missing out?

ConfigurationBuilder builder = new ConfigurationBuilder();

            // Access Token
            String access_token = mSharedPreferences.getString(
                    PREF_KEY_OAUTH_TOKEN, "");
            // Access Token Secret
            String access_token_secret = mSharedPreferences.getString(
                    PREF_KEY_OAUTH_SECRET, "");

            AccessToken accessToken = new AccessToken(access_token,
            Twitter twitter = new TwitterFactory(builder.build())

            // Update status
            twitter4j.Status response = twitter.updateStatus(status);