FacebookのAndroidチュートリアルからログアウトコードをコピーしました。ログアウトしようとするたびに、nullポインタ例外が発生します。
これがコードです...
private AsyncFacebookRunner mAsyncRunner;
..。
mAsyncRunner.logout(home.this, new RequestListener() {
@Override
public void onComplete(String response, Object state)
{
/* mPrefs.edit().putBoolean("firstTime", true).commit();
userName.setText("Logged out!");*/
}
@Override
public void onIOException(IOException e, Object state) {
Log.d("IOExcenption", e.toString());
}
@Override
public void onFileNotFoundException(FileNotFoundException e,
Object state) {
Log.d("FileNotFoundException", e.toString());
}
@Override
public void onMalformedURLException(MalformedURLException e,
Object state) {
Log.d("MalformedUrlExpection", e.toString());
}
@Override
public void onFacebookError(FacebookError e, Object state) {
Log.d("FacebookError", e.toString());
}
});
ログ
04-29 23:41:35.523: E/AndroidRuntime(1011): java.lang.NullPointerException
04-29 23:41:35.523: E/AndroidRuntime(1011): at rageup.android.home.onClick(home.java:177)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.View.performClick(View.java:2364)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.View.onTouchEvent(View.java:4179)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.widget.TextView.onTouchEvent(TextView.java:6541)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.View.dispatchTouchEvent(View.java:3709)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
04-29 23:41:35.523: E/AndroidRuntime(1011): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
04-29 23:41:35.523: E/AndroidRuntime(1011): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
04-29 23:41:35.523: E/AndroidRuntime(1011): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.os.Handler.dispatchMessage(Handler.java:99)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.os.Looper.loop(Looper.java:123)
04-29 23:41:35.523: E/AndroidRuntime(1011): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-29 23:41:35.523: E/AndroidRuntime(1011): at java.lang.reflect.Method.invokeNative(Native Method)
04-29 23:41:35.523: E/AndroidRuntime(1011): at java.lang.reflect.Method.invoke(Method.java:521)
04-29 23:41:35.523: E/AndroidRuntime(1011): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-29 23:41:35.523: E/AndroidRuntime(1011): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-29 23:41:35.523: E/AndroidRuntime(1011): at dalvik.system.NativeStart.main(Native Method)
04-29 23:41:35.534: I/dalvikvm(1011): threadid=7: reacting to signal 3
04-29 23:41:35.534: E/dalvikvm(1011): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-29 23:41:37.283: I/Process(1011): Sending signal. PID: 1011 SIG: 9
なぜこれが起こっているのかについての提案はありますか?Null Pointer例外は、コードの2番目のブロックの最初の行を参照しています。