Java 类型视图中的方法setOnClickListener(View.OnClickListener)不适用于参数(startingpoint)

Java 类型视图中的方法setOnClickListener(View.OnClickListener)不适用于参数(startingpoint),java,android,twitter,Java,Android,Twitter,我正在尝试使用android开发一个twitter客户端。除了行“signIn.setOnClickListener(this);”之外,我的整个代码目前都没有错误。我试着按照其他的建议去做,但似乎没有用。报告的错误是“类型视图中的方法setOnClickListener(View.OnClickListener)不适用于参数(startingpoint)”。根据建议,我似乎应该使用“查看”而不是“签名”。可能的解释是什么?我需要在哪里更正代码 package com.HIT.bjak; im

我正在尝试使用android开发一个twitter客户端。除了行“signIn.setOnClickListener(this);”之外,我的整个代码目前都没有错误。我试着按照其他的建议去做,但似乎没有用。报告的错误是“类型视图中的方法setOnClickListener(View.OnClickListener)不适用于参数(startingpoint)”。根据建议,我似乎应该使用“查看”而不是“签名”。可能的解释是什么?我需要在哪里更正代码

package com.HIT.bjak;

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class startingpoint extends Activity implements OnClickListener {

/** developer account key for this app */
public final static String TWIT_KEY = "xxx";
/** developer secret for the app */
public final static String TWIT_SECRET = "xxx";
/** app url */
public final static String TWIT_URL = "bjak-android:///";
/** Twitter instance */
private Twitter bjak_instance;
/** request token for accessing user account */
private RequestToken bjak_RequestToken;
/** shared preferences to store user details */
private SharedPreferences Prefs;

// for error logging
private String LOG_TAG = "startingpoint";

Button signIn;
String oaVerifier=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    // get the preferences for the app
    bjak_instance = (Twitter) getSharedPreferences("TweetPrefs", 0);

    // find out if the user preferences are set
    if ( Prefs.getString("user_token", null) == null) {

        // no user preferences so prompt to sign in
        setContentView(R.layout.main);
        // get a twitter instance for authentication
        bjak_instance = new TwitterFactory().getInstance();

        // pass developer key and secret
        bjak_instance.setOAuthConsumer(TWIT_KEY, TWIT_SECRET);
        // try to get request token
        try {
            // get authentication request token
            bjak_RequestToken = bjak_instance.getOAuthRequestToken(TWIT_URL);
        } catch (TwitterException te) {
            Log.e(LOG_TAG, "TE " + te.getMessage());
        }
        // setup button for click listener
        signIn = (Button)findViewById(R.id.signin);
        signIn.setOnClickListener(this);
        //attempt to retrieve access token
        try
        {
            //try to get an access token using the returned data from the verification page
            AccessToken accToken = bjak_instance.getOAuthAccessToken(bjak_RequestToken, oaVerifier);

            //add the token and secret to shared prefs for future reference
            Prefs.edit()
                .putString("user_token", accToken.getToken())
                .putString("user_secret", accToken.getTokenSecret())
                .commit();

            //display the timeline
            setupTimeline();
        }
        catch (TwitterException te)
        { Log.e(LOG_TAG, "Failed to get access token: " + te.getMessage()); }

    } else {
        // user preferences are set - get timeline
        setupTimeline();
    }
}

/**
 * Click listener handles sign in and tweet button presses
 */
public void onClick(View v) {
    // find view
    switch (v.getId()) {
    // sign in button pressed
    case R.id.signin:
        // take user to twitter authentication web page to allow app access
        // to their twitter account
        String authURL = bjak_RequestToken.getAuthenticationURL();
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authURL)));
        break;
    // other listeners here

    default:
        break;
    }

}
/*
 * onNewIntent fires when user returns from Twitter authentication Web page
 */
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    //get the retrieved data
    Uri twitURI = intent.getData();
    //make sure the url is correct
    if(twitURI!=null && twitURI.toString().startsWith(TWIT_URL))
    {
        //is verifcation - get the returned data
        oaVerifier = twitURI.getQueryParameter("oauth_verifier");

    }
}
private void setupTimeline() {
    Log.v(LOG_TAG, "setting up timeline");
    }

@Override
public void onClick(DialogInterface dialog, int which) {
    // TODO Auto-generated method stub

}

}`

这是因为活动实现的接口错误

import android.content.DialogInterface.OnClickListener;
...
public class startingpoint extends Activity implements OnClickListener {
您应该实现这个接口
View.OnClickListener