title: Unable to add footer in a list in android studio
body: <p>I am new to android programming and sorry if this question is asked before.
  But I am unable to add footer in my list view, which contains reviews and rating data coming from service. I want only 1 item to be shown and after that a footer to read more should appear. 
  My code is:</p>
  
  <pre><code>// Footer to add
          final TextView tvReadAll = new TextView(this);
          tvReadAll.setTextSize(17f);
          tvReadAll.setGravity(Gravity.CENTER_HORIZONTAL);
          tvReadAll.setTextColor(R.drawable.list_selector);
          tvReadAll.setText("Read All Reviews");
  
          int limit =1;
          for(int length=0;length&lt;limit;length++) {
              mLvReviews.getAdapter().getItem(1);
              mLvReviews.addFooterView(tvReadAll);
          }
  
          tvReadAll.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Utility.setListViewHeightBasedOnChildren(mLvReviews);
                  tvReadAll.setVisibility(View.GONE);
  
              }
          });
  
          adapter = new UserReviewsAdapter(ProDetailedInfo.this, array);
          mLvReviews.setAdapter(adapter);
  </code></pre>
  
  <p>But this footer doesnot show. This is my logcat</p>
  
  <pre><code>  java.lang.NullPointerException
                                                                           at android.sit.findpro.ProDetailedInfo.reviewsAndRatings(ProDetailedInfo.java:220)
                                                                           at android.sit.findpro.ProDetailedInfo.access$600(ProDetailedInfo.java:50)
                                                                           at android.sit.findpro.ProDetailedInfo$1.onResponse(ProDetailedInfo.java:117)
                                                                           at retrofit.ExecutorCallAdapterFactory$ExecutorCallback$1.run(ExecutorCallAdapterFactory.java:84)
                                                                           at android.os.Handler.handleCallback(Handler.java:808)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:103)
                                                                           at android.os.Looper.loop(Looper.java:193)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5292)
                                                                           at java.lang.reflect.Method.invokeNative(Native Method)
                                                                           at java.lang.reflect.Method.invoke(Method.java:515)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
                                                                           at dalvik.system.NativeStart.main(Native Method)
  </code></pre>