Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:53:21+00:00 2026-06-03T23:53:21+00:00

I am trying to update my status using SSO and with an onClickListener on

  • 0

I am trying to update my status using SSO and with an onClickListener on some text and I am getting an interface not implemented handler error when I click on the post_badge_text.

Here is the source for the class.

import com.facebook.android.BaseDialogListener;
import com.facebook.android.Facebook;
import com.facebook.android.R;
import com.facebook.android.Utility;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.facebook.android.Facebook.*;


public class SocialSharing extends Activity{

private static final String APP_ID = "286529654765268";
//private static final String[] PERMISSIONS = new String[] {"publish_stream"};
private static final String TOKEN = "access_token";
private static final String EXPIRES = "expires_in";
private static final String KEY = "facebook-credentials";
private Facebook facebook = new Facebook(APP_ID);
private EditText edittext;
private ImageView badge;
private TextView post_badge_text;
private TextView update_status_text;
private TextView post_achievement_text;
private TextView tweet_badge_text;
private TextView invite_friends_text;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.socialsharing);

    //Make references to all our views
    edittext = (EditText) findViewById(R.id.edittext);
    badge = (ImageView) findViewById(R.id.badge);
    post_badge_text = (TextView) findViewById(R.id.post_badge_text);
    update_status_text = (TextView) findViewById(R.id.update_status_text);
    post_achievement_text = (TextView) findViewById(R.id.post_achievement_text);
    tweet_badge_text = (TextView) findViewById(R.id.tweet_badge_text);
    invite_friends_text = (TextView) findViewById(R.id.invite_friends_text);


    if(restore(facebook, getApplicationContext())){
    //authorize the user. 
    facebook.authorize(this, new DialogListener() {
        @Override
        public void onComplete(Bundle values) {
            Toast.makeText(getApplicationContext(), "Successfully Logged In to facebook!", Toast.LENGTH_LONG).show();
        }

        @Override
        public void onCancel() {}

        @Override
        public void onFacebookError(com.facebook.android.FacebookError e) {
            e.printStackTrace();
                        if(facebook.isSessionValid()){
                Toast.makeText(getApplicationContext(), "Successfully Logged in to Facebook!", Toast.LENGTH_LONG).show();
            }
            else{
                Log.e("FACEBOOK FAIL", "Facebook has epicly failed with an error in onCreate in Social Sharing or you are logged in already");
            }
        }

        @Override
        public void onError(com.facebook.android.DialogError e) {
            // TODO Auto-generated method stub

        }
    });
    } else { save(facebook, getApplicationContext()); }

    /*
     * callback for the feed dialog which updates the profile status
     */
    class UpdateStatusListener extends BaseDialogListener {

        public void onComplete(Bundle values) {
            final String postId = values.getString("post_id");
            if (postId != null) {
                new UpdateStatusResultDialog(SocialSharing.this, "Update Status executed", values)
                        .show();
            } else {
                Toast toast = Toast.makeText(getApplicationContext(), "No wall post made",
                        Toast.LENGTH_SHORT);
                toast.show();
            }
        }
    }

    //check for clicks
    post_badge_text.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
             Bundle params = new Bundle();
             params.putString("caption", getString(R.string.app_name));
             params.putString("description", getString(R.string.app_desc));
             params.putString("picture", Utility.HACK_ICON_URL);
             params.putString("name", getString(R.string.app_action));

             Utility.mFacebook.dialog(SocialSharing.this, "feed", params, new UpdateStatusListener());
             String access_token = Utility.mFacebook.getAccessToken();
             Log.e("accessToken", "access Token is " + access_token);
             System.out.println(access_token);


        }
    });

}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    facebook.authorizeCallback(requestCode, resultCode, data);
}

/*
 * Save the access token and expiry date so you don't have to fetch it each
 * time
 */

public static boolean save(Facebook session, Context context) {
    Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();
    editor.putString(TOKEN, session.getAccessToken());
    editor.putLong(EXPIRES, session.getAccessExpires());
    return editor.commit();
}

/*
 * Restore the access token and the expiry date from the shared preferences.
 */
public static boolean restore(Facebook session, Context context) {
    SharedPreferences savedSession = context.getSharedPreferences(KEY, Context.MODE_PRIVATE);
    session.setAccessToken(savedSession.getString(TOKEN, null));
    session.setAccessExpires(savedSession.getLong(EXPIRES, 0));
    return session.isSessionValid();
}


}

Here is the error I am getting:

05-09 12:31:22.300: E/Handler(12860): Failed to handle callback; interface not implemented, callback:android.view.View$PerformClick@40d37250
05-09 12:31:22.300: E/Handler(12860): java.lang.NullPointerException
05-09 12:31:22.300: E/Handler(12860):   at org.jujitsu.app.com.SocialSharing$2.onClick(SocialSharing.java:114)
05-09 12:31:22.300: E/Handler(12860):   at android.view.View.performClick(View.java:3538)
05-09 12:31:22.300: E/Handler(12860):   at android.view.View$PerformClick.run(View.java:14330)
05-09 12:31:22.300: E/Handler(12860):   at android.os.Handler.handleCallback(Handler.java:607)
05-09 12:31:22.300: E/Handler(12860):   at android.os.Handler.dispatchMessage(Handler.java:92)
05-09 12:31:22.300: E/Handler(12860):   at android.os.Looper.loop(Looper.java:154)
05-09 12:31:22.300: E/Handler(12860):   at android.app.ActivityThread.main(ActivityThread.java:4974)
05-09 12:31:22.300: E/Handler(12860):   at java.lang.reflect.Method.invokeNative(Native Method)
05-09 12:31:22.300: E/Handler(12860):   at java.lang.reflect.Method.invoke(Method.java:511)
05-09 12:31:22.300: E/Handler(12860):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-09 12:31:22.300: E/Handler(12860):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-09 12:31:22.300: E/Handler(12860):   at dalvik.system.NativeStart.main(Native Method)

I am really stuck with this error… any help would be great. thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:53:23+00:00Added an answer on June 3, 2026 at 11:53 pm

    Its fixed now. It was a small error in my code that I didnt notice. an override was in the class and not the method for some reason cheers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying the to query my Status Update repository using the following var
I am trying to update the status using tweetsharp oauth preview 17. Please let
I am trying to update status on twitter using twitter4j. Everything works fine on
Trying to post a status update using facebook php sdk. Code posted below. As
I'm trying to post a Facebook status update, using the Facebook iOS API, with
I'm using Oledb as my database and I'm trying to update the Status column
I am trying to update some custom fields using the REST API and PHP/cURL.
I am trying to update the status of a column, by checking two joined
I'm trying to insert status update into my database in table called blabbing, but
I'm trying to format a box to look like a status update like feature.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.