android - Java.lang.NullPointerException Error in the code -


I am getting an error which says as a Java tap point exception. I tried debugging and saw that the error only continues I think that there is a problem with printwriter or the client object

Is this an initialization error?

I have closed every socket too.

Is there something like I have some other place? The code is:

  package com.example.temp; Public Class Main Activity Activity (Personal Socket Client; Private PrintWriter PrintRighter; Private Editing Test Textfield; Private Button Button; Private String Messsage; StringBinder SB = New StringBuilder (); Public Final Static String Extra = "com.example.temp.MESSAGE" ; Secured Last Fixed Time TIME_DELAY = 5000; TextView mTextView; Handler Handler = New Handler (); Int count = 0; String Data = "; @ Override Protected Zero (Create Bundle Get InstantStat) {Super. NET (Saved InstantState); setContentView (R.layout.activity_main); MTextView = (TextView) Find ViewById (R.id.text_id); Messsage = mTextView.getText (). ToString (); New Assictsk () .modsage; handler.post (updateTextRunnable);} Runnabal updatetestnableNew = new Runnabal () {Public Zero Run (if (calculated & lt; 5) {WiFi Manager Main WiFiO OBJE; MainWifiObj = ( WifiManager) getSystemService (Reference .wIFI_SERVICE); Class WifiScanReceiver Expands Broadcast Receiver Iv (reference C, Intent intent) {}} Waifaiskan Risevr Waifaiarisivr = new Waifaiskan Risevr (); Register receiver (wifi, new intent filter (wifi manager) SCAN_RESULTS_AVAILABLE_ACTION); & Lt; ScanResult & gt; WifiScanList = mainWifiObj.getScanResults (); (As a result of the scan result: WiFiScanList) {If (result, SSID. Angle ("Khosla ka Ghosh")) {sb.append (result.level); } Calculate ++; MTextView.setText ("Call" + Count + SB); } Else {} handler.Post Delayed (this, TIME_DELAY); }}; Public Class Asynchronous Ascend Task & lt; String, Wide, Viood & gt; {Private Static Last String IP_ADDRESS = "192.168.0.8"; Personal fixed final difference DEST_PORT = 4444; Private editing text mTextField; Protected voice doinbackground (string ... message) {string message = message [0]; Socket client = null; {Client = new socket (try IP_ADADAR, DESTAP); // Connect to Server} Hold (unknownHostException E) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); } // Write on the server {Printwriter = new PrintWriter (try the client.getOutputStream (), correct); Printwriter.write (in the background); // Write the message to the output stream} Grip (IOException e) {e.printStackTrace (); } Finally {try {if (client! = Null) {printwriter.flush ()); Printwriter.close (); Client.close (); }} Hold (IOException e) {e.printStackTrace (); }} Return tap; }}}  

When I run the current code, the error line comes in: printwriter.write (messsage) . Can you please guide me with it

Thank you in advance

It end block

  if (printstructor! = Null) {printwriter.flush (); Printwriter.close (); }  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -