title: I am getting Null pointer exception when i run my app 2nd time
body: <pre><code>java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference
  </code></pre>
  
  <p>This is the line where the exception is pointing to</p>
  
  <pre><code>  String tot=avg[i+2];
               total=Float.parseFloat(tot);
  </code></pre>
  
  <p>and </p>
  
  <pre><code> adapter=new VivaAdapter(Attendance.this,gedata());
  </code></pre>
  
  <p>I am recieving data in form of string and then converting it into float  ,but the app runs fine first time but second time it throws exception</p>
  
  <p>I tried to change avg[i+2].trim() but dint worked</p>
  
  <p>App crashes every alternative time</p>
  
  <p>Eception log:</p>
  
  <pre><code>/AndroidRuntime: FATAL EXCEPTION: main
                                                                                        Process: com.example.rushabh123453.attendancepict, PID: 643
                                                                                        java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference
                                                                                            at java.lang.StringToReal.parseFloat(StringToReal.java:304)
                                                                                            at java.lang.Float.parseFloat(Float.java:306)
                                                                                            at com.example.rushabh123453.attendancepict.Attendance$Networking1.onPostExecute(Attendance.java:189)
                                                                                            at android.os.AsyncTask.finish(AsyncTask.java:636)
                                                                                            at android.os.AsyncTask.access$500(AsyncTask.java:177)
                                                                                            at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653)
                                                                                            at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                            at android.os.Looper.loop(Looper.java:211)
                                                                                            at android.app.ActivityThread.main(ActivityThread.java:5389)
                                                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                                                            at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
                                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
  </code></pre>