title: Add TextView to PopupWindow
body: <pre><code>private PopupWindow datepicker;
  private void popupDatePicker() {
  try {
      // We need to get the instance of the LayoutInflater
      LayoutInflater inflater = (LayoutInflater) Tabs.this
      .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View layout = inflater.inflate(R.layout.popup_datepicker,
      (ViewGroup) findViewById(R.id.popup_element));
      TextView valueTV;
      LinearLayout linearLayout = (LinearLayout) findViewById(R.id.linear_layout);
      //add LayoutParams
      LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
  
      //add textView
      valueTV = new TextView(this);
      valueTV.setText("buy the ticket, take the ride");
      valueTV.setId(5);
      valueTV.setTextColor(Color.WHITE);
      valueTV.setLayoutParams(params);
  
      //add the textView to LinearLayout
      linearLayout.addView(valueTV);
      datepicker = new PopupWindow(layout, 300, 370, true);
      datepicker.setOutsideTouchable(true); 
      datepicker.setBackgroundDrawable(new BitmapDrawable()); 
      datepicker.setFocusable(true);
      datepicker.showAtLocation(layout, Gravity.CENTER, 0, 0);
  
  
  } catch (Exception e) {
  e.printStackTrace();
  }
  }
  </code></pre>
  
  <p>I'm getting an error at the <b>linearLayout.addView(valueTV);</b> line. Not sure what is wrong. The popup isn't even coming up. I tried moving some things around, but it is still not working. </p>
  
  <p>Here's the Log Cat documenting the problem:</p>
  
  <pre><code>12-07 00:46:54.984: W/System.err(882): java.lang.NullPointerException
  12-07 00:46:55.044: W/System.err(882):  at com.package.Tabs.popupDatePicker(Tabs.java:503)
  12-07 00:46:55.044: W/System.err(882):  at com.package.Tabs.access$8(Tabs.java:483)
  12-07 00:46:55.044: W/System.err(882):  at com.package.less.Tabs$10.onClick(Tabs.java:307)
  12-07 00:46:55.044: W/System.err(882):  at android.view.View.performClick(View.java:4424)
  12-07 00:46:55.044: W/System.err(882):  at android.view.View$PerformClick.run(View.java:18383)
  12-07 00:46:55.044: W/System.err(882):  at android.os.Handler.handleCallback(Handler.java:733)
  12-07 00:46:55.044: W/System.err(882):  at android.os.Handler.dispatchMessage(Handler.java:95)
  12-07 00:46:55.074: W/System.err(882):  at android.os.Looper.loop(Looper.java:137)
  12-07 00:46:55.084: W/System.err(882):  at android.app.ActivityThread.main(ActivityThread.java:4998)
  12-07 00:46:55.084: W/System.err(882):  at java.lang.reflect.Method.invokeNative(Native Method)
  12-07 00:46:55.084: W/System.err(882):  at java.lang.reflect.Method.invoke(Method.java:515)
  12-07 00:46:55.154: W/System.err(882):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
  12-07 00:46:55.184: W/System.err(882):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
  12-07 00:46:55.194: W/System.err(882):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>