我真的不确定为什么要这样做,但这似乎是括号的问题。在 Eclipse 中为 Android 运行这段代码时出现以下错误:
private static final String TWITTER_ACCESS_TOKEN_URL = "http://api.twitter.com/oauth/access_token";
private static final String TWITTER_AUTHORZE_URL = "https://api.twitter.com/oauth/authorize";
private static final String TWITTER_REQUEST_URL = "https://api.twitter.com/oauth/request_token";
public static final String itemOfClothing;
public static final String clothingEmotion;
public static final String user;<<<<<<<<<<<<<<<<<<<<< Syntax error on token ";", { expected after this token
itemOfClothing = "pants";
clothingEmotion = "I'm feeling left in the dark";
user = "stuart";
public static String MESSAGE = itemOfClothing +": " + clothingEmotion + "! #" + user + "EmotionalClothing"; <<<<<<<<<<<<<<<<<<<<<< Syntax error, insert "}" to complete Block
public TwitterApp(Activity context, String consumerKey, String secretKey) {
this.context = context;