For some unknown reason I'm getting FATAL EXCEPTION: main - java.lang.NullPointerException on the line:
x_button.setOnClickListener(new View.OnClickListener() {
but I'm not sure why this is happening. The button is there - so I'm not sure why a null pointer would occur at this point - but it is.
Any input is greatly appreciated.
SOURCE SNIPPET:
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
// Show updated screen if table was successfully updated
// Or alert indicating settings are not updated
if (result.equals("success")) {
setContentView(R.layout.completion);
} else
setContentView(R.layout.error);
Button x_button = (Button) findViewById(R.id.x_button);
x_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finishAll(v);
}
});
}
LOGCAT:
08-26 15:49:42.419: W/System.err(5998): java.io.IOException: Stream is closed
08-26 15:49:42.429: W/System.err(5998): at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:161)
08-26 15:49:42.429: W/System.err(5998): at java.io.DataInputStream.read(DataInputStream.java:95)
08-26 15:49:42.429: W/System.err(5998): at java.io.InputStreamReader.read(InputStreamReader.java:255)
08-26 15:49:42.429: W/System.err(5998): at java.io.BufferedReader.fillBuf(BufferedReader.java:128)
08-26 15:49:42.429: W/System.err(5998): at java.io.BufferedReader.readLine(BufferedReader.java:357)
08-26 15:49:42.429: W/System.err(5998): at com.tracfone.straighttalk.networktasklibrary.NetworkTask.doInBackground(NetworkTask.java:37)
08-26 15:49:42.429: W/System.err(5998): at com.tracfone.straighttalk.networktasklibrary.NetworkTask.doInBackground(NetworkTask.java:1)
08-26 15:49:42.429: W/System.err(5998): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-26 15:49:42.429: W/System.err(5998): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-26 15:49:42.429: W/System.err(5998): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-26 15:49:42.429: W/System.err(5998): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-26 15:49:42.429: W/System.err(5998): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-26 15:49:42.429: W/System.err(5998): at java.lang.Thread.run(Thread.java:1019)
08-26 15:49:46.299: W/dalvikvm(5998): threadid=1: thread exiting with uncaught exception (group=0x4016e560)
08-26 15:49:46.299: E/AndroidRuntime(5998): FATAL EXCEPTION: main
08-26 15:49:46.299: E/AndroidRuntime(5998): java.lang.NullPointerException
08-26 15:49:46.299: E/AndroidRuntime(5998): at com.project.new.datasettings.ConfigFinalActivity$TableUpdateRequestTask.onPostExecute(ConfigFinalActivity.java:552)
08-26 15:49:46.299: E/AndroidRuntime(5998): at com.project.new.datasettings.ConfigFinalActivity$TableUpdateRequestTask.onPostExecute(ConfigFinalActivity.java:1)
08-26 15:49:46.299: E/AndroidRuntime(5998): at android.os.AsyncTask.finish(AsyncTask.java:417)
08-26 15:49:46.299: E/AndroidRuntime(5998): at android.os.AsyncTask.access$300(AsyncTask.java:127)
08-26 15:49:46.299: E/AndroidRuntime(5998): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
08-26 15:49:46.299: E/AndroidRuntime(5998): at android.os.Handler.dispatchMessage(Handler.java:99)
08-26 15:49:46.299: E/AndroidRuntime(5998): at android.os.Looper.loop(Looper.java:130)
08-26 15:49:46.299: E/AndroidRuntime(5998): at android.app.ActivityThread.main(ActivityThread.java:3821)
08-26 15:49:46.299: E/AndroidRuntime(5998): at java.lang.reflect.Method.invokeNative(Native Method)
08-26 15:49:46.299: E/AndroidRuntime(5998): at java.lang.reflect.Method.invoke(Method.java:507)
08-26 15:49:46.299: E/AndroidRuntime(5998): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
08-26 15:49:46.299: E/AndroidRuntime(5998): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
08-26 15:49:46.299: E/AndroidRuntime(5998): at dalvik.system.NativeStart.main(Native Method)
FULL SOURCE:
https://docs.google.com/document/d/1ap5qknNcn9RaJhewc9CarQja2uS4Xjgtzw4eNzXzLKY/edit?usp=sharing