Norm Radder wrote:
won't update to server
What server are you talking about? What protocol are you using to send the String to the server?
Why do you have to use the debugger to see the error message? Can the code receive/extract the message and print it on the logcat?
Norm Radder wrote:
my app doesn't crash
What happens when you execute the app?
Norm Radder wrote:
i am getting this error.
Can you copy the stacktrace from the logcat and paste it here so we can see the full error?
Norm Radder wrote:
java.lang.NullPointerException: Attempt to read from field 'android.widget.TextView com.nswd.successplan.databinding.TvContentBinding.markerValue' on a null object reference
at com.nswd.successplan.model.HomePieChartMarkerViewModel.refreshContent(HomePieChartMarkerViewModel.java:32)
What variable on line 32 has the null value? Backtrack in the code to see why that variable is null.
Norm Radder wrote:I think the problem is that the InputStreamReader on line 24 has read all the contents of the stream into its buffer and the read statement returns the first character from the buffer: { Note (char)123 is {
There is no more data in the stream so the InputStream used on line 28 returns the -1.
Try using the InuputStreamReader for all the reads, not the InputStream.
Norm Radder wrote:Try adding a print statement after the statements on lines 24 and 28 that print out the value of podaci so you can see what is read.