title: Android: NumberPicker does not behave properly
body: <p>I have two number pickers in a layout and I am using the layout for an AlertDialog Box. However the two number pickers do not have scrollers that are used to increase/decrease the value. Also I am not able to manually input values. Can anyone please help me find the bugs.</p>
  
  <p>Dialog.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;LinearLayout 
      android:id="@+id/llinner"
      android:orientation="horizontal"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true" 
      android:layout_centerHorizontal="true" &gt;
  
      &lt;NumberPicker
          android:id="@+id/attnp1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
      &lt;LinearLayout 
          android:id="@+id/llinnermost"
          android:orientation="vertical"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" 
          android:paddingTop="50sp"&gt;
  
          &lt;TextView 
              android:id="@+id/innertv"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="out of"
              android:textSize="20sp"
              android:paddingLeft="15sp"
              android:paddingRight="15sp" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;NumberPicker
          android:id="@+id/attnp2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Code snipper from activity that accesses this layout:</p>
  
  <pre><code>LayoutInflater lf = LayoutInflater.from(List_of_Courses.this);
  
              final View DialogView = lf.inflate(R.layout.dialog, null);
  
  
              final NumberPicker np1 = (NumberPicker) DialogView.findViewById(R.id.attnp1);
              final NumberPicker np2 = (NumberPicker) DialogView.findViewById(R.id.attnp2);
              np1.setValue(prevatt);
              np2.setValue(prevtot);
  
  
  
              final AlertDialog.Builder alert = new AlertDialog.Builder(List_of_Courses.this);
              alert.setTitle(cn+" - Attendance").setView(DialogView).setPositiveButton("OK", 
                      new DialogInterface.OnClickListener() {
  
                          @Override
                          public void onClick(DialogInterface dialog, int whichbutton) {
  
                              if(np1.getValue() == 0 || np2.getValue() == 0)return;
                              int att = np1.getValue();
                              int tot = np2.getValue();
                              if(att&lt;=tot &amp;&amp; tot&gt;0){
                                  db.UpdateAttendanceinSingleCourse(courseid, att, tot);
                                  Toast.makeText(getApplicationContext(), "Attendance Updated", Toast.LENGTH_SHORT).show();
                              }
                              else {
                                  RaiseException();
                              }
                              db.close();
                              onResume();
                          }
                      }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  
                          @Override
                          public void onClick(DialogInterface dialog, int whichbutton) {
                              Log.v("CancelDialog", "User clicked Cancel");
                          }
                      });
              alert.show();
  </code></pre>