title: ViewPostIme pointer 1/0
body: <p>I have the following code with no compilation errors, just resulting in an infinite loop... I don't get where the problem is.</p>
  <p>When I click the Button, I want to create an object using the values entered in the edittexts and pass them to another activity. But instead, I get a loop.</p>
  <p>Each spinner is populated using a string-array from resources/strings. I had some difficulties getting the values here, because at the spinner <code>spTipUtilizator</code> when &quot;Profesor&quot; is selected, I want <code>spGrupa</code> to be disabled, and when &quot;Student&quot; is selected, I want <code>spdept</code> to be disabled, but also this doesn't work. And based on that option will be chosen the next activity which will be opened after clicking the button.</p>
  <p>Also, why doesn't it work to set the default date in my calendar? I tried multiple things found here, but none of them worked for me. My Android Studio doesn't show <code>DatePicker</code>, which I would prefer, only that Calendar.</p>
  <pre class="lang-java prettyprint-override"><code>public class SignInActivity extends Activity {
  
      private Button bSignup;
      private EditText etNume, etPrenume, etUsername, etPassword, etConfirmPass, etEmail;
      private RadioButton rbMasc, rbFem;
      private Spinner spTipUtilizator, spgrupa, spdept;
      private ProgressBar progBar;
      private Calendar calendar;
      private int year, month, day, currentYear, defday, defmonth, defyear;
      private List&lt;String&gt; tipUtilizatorList, grupaList;
      private ArrayAdapter&lt;String&gt; spinnerArrayAdapterTipU;
      private String nume,prenume,username,password,password2,email,masc,fem,sex,tipUser,dept,DataN;
      private int grupa;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_sign_in);
  
          calendar=Calendar.getInstance();
          calendar.set(1990,12,12);
  
          bSignup = findViewById(R.id.buttonSignin);
          etNume=findViewById(R.id.et_nume);
          etPrenume=findViewById(R.id.et_prenume);
          etUsername=findViewById(R.id.et_username);
          etPassword=findViewById(R.id.et_password);
          etConfirmPass = findViewById(R.id.et_confirmpassword);
          etEmail=findViewById(R.id.et_email);
          rbMasc=findViewById(R.id.radioButtonMasc);
          rbFem=findViewById(R.id.radioButtonFem);
          spTipUtilizator=findViewById(R.id.spinnerTipUtilizator);
          spgrupa=findViewById(R.id.spinnerGrupa);
          spdept=findViewById(R.id.spinnerDepartament);
  
          progBar = findViewById(R.id.progressBar);
  
          tipUtilizatorList=new ArrayList&lt;&gt;(Arrays.asList(getResources().getStringArray((R.array.tipUtilizator))));
          ArrayAdapter&lt;String&gt; adapter=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item,tipUtilizatorList);
          adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          spTipUtilizator.setAdapter(adapter);
  
          grupaList = new ArrayList&lt;&gt;(Arrays.asList(getResources().getStringArray(R.array.grupa)));
  
  
          bSignup.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
                  nume = etNume.getText().toString().trim();
                  prenume = etPrenume.getText().toString().trim();
                  username = etUsername.getText().toString().trim();
                  password = etPassword.getText().toString().trim();
                  password2 = etConfirmPass.getText().toString().trim();
                  email = etEmail.getText().toString().trim();
                  masc = rbMasc.getText().toString().trim();
                  fem = rbFem.getText().toString().trim();
                  sex=fem;
                  tipUser = spTipUtilizator.getSelectedItem().toString().trim();
                  grupa = Integer.parseInt(spgrupa.getSelectedItem().toString().trim());
                  dept = spdept.getSelectedItem().toString().trim();
                  DataN = day+&quot;/&quot;+month+&quot;/&quot;+year;
  
                  progBar.setVisibility(View.VISIBLE);
  
                  if(rbFem.isChecked()) {
                      sex=fem;
                  }
                  else if(rbMasc.isChecked()) {
                      sex=masc;
                  }
  
                 
                  spTipUtilizator.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                      @Override
                      public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                          String Text = parent.getSelectedItem().toString();
                          if(Text.equals(&quot;Profesor&quot;)) {
                              spgrupa.getSelectedView().setEnabled(false);
                              spdept.getSelectedView().setEnabled(true);
  
                              Intent intent = new Intent(getApplicationContext(),StartProfesorActivity.class);
                              Profesor prof = new Profesor(nume,prenume,username,password,email,sex,dept,DataN);
                              intent.putExtra(&quot;profesor&quot;,prof);
                              startActivity(intent);
                              return;
                          }
                          else if(Text.equals(&quot;Student&quot;)) {
                              spgrupa.getSelectedView().setEnabled(true);
                              spdept.getSelectedView().setEnabled(false);
  
                              Intent intent = new Intent(getApplicationContext(),StartStudentActivity.class);
                              Student stud = new Student(nume,prenume,username,password,email,sex,grupa, DataN);
                              intent.putExtra(&quot;student&quot;,stud);
                              startActivity(intent);
                              return;
                          }
  
                      }
  
                      @Override
                      public void onNothingSelected(AdapterView&lt;?&gt; parent) {
  
                      }
                  });
  
              }
          });
      }
  }
  </code></pre>
  <p>Log:</p>
  <pre><code>D/AbsListView:  in onLayout changed 
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: MSG_WINDOW_FOCUS_CHANGED 1
  V/InputMethodManager: Not IME target window, ignoring
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: MSG_RESIZED_REPORT: frame=Rect(266, 72 - 422, 1047) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
  D/ViewRootImpl@27d7010[SignInActivity]: MSG_WINDOW_FOCUS_CHANGED 0
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: ViewPostIme pointer 0
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: ViewPostIme pointer 1
  D/AbsListView: onTouchUp() mTouchMode : 0
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: Relayout returned: old=[266,72][422,1047] new=[266,72][422,1047] result=0x1 surface={valid=true 481098420224} changed=false
  D/ViewRootImpl@27d7010[SignInActivity]: MSG_WINDOW_FOCUS_CHANGED 1
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: MSG_WINDOW_FOCUS_CHANGED 0
  I/zygote64: Compiler allocated 4MB to compile void android.view.View.&lt;init&gt;(android.content.Context, android.util.AttributeSet, int, int)
  I/OpenGLRenderer: prepareTree mLayerUpdateQueue is not empty, size = 1
      name = PopupWindow$PopupBackgroundView, size (156, 975)
  D/OpenGLRenderer: eglDestroySurface = 0x6ff4459d80
      endAllActiveAnimators on 0x6ff591ec00 (DropDownListView) with handle 0x7003b6eb00
  D/ViewRootImpl@cab402e[PopupWindow:ad4e773]: dispatchDetachedFromWindow
  D/InputEventReceiver: channel '468478f PopupWindow:ad4e773 (client)' ~ Disposing input event receiver.
      channel '468478f PopupWindow:ad4e773 (client)' ~NativeInputEventReceiver.
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 0
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 1
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 0
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 1
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 0
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 1
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 0
  D/ViewRootImpl@27d7010[SignInActivity]: ViewPostIme pointer 1
  V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@54a19af nm : com.example.ancaa.proiectandroidquiz ic=com.android.internal.widget.EditableInputConnection@ba71bc
  I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
  W/IInputConnectionWrapper: getCursorCapsMode on inactive InputConnection
  W/IInputConnectionWrapper: getCursorCapsMode on inactive InputConnection
  W/IInputConnectionWrapper: getSelectedText on inactive InputConnection
  W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
  W/IInputConnectionWrapper: getTextAfterCursor on inactive InputConnection
  W/IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
  D/OpenGLRenderer: eglDestroySurface = 0x7003ab7400
  D/ViewRootImpl@27d7010[SignInActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x5 surface={valid=false 0} changed=true
  D/ViewRootImpl@27d7010[SignInActivity]: MSG_WINDOW_FOCUS_CHANGED 0
  D/ViewRootImpl@27d7010[SignInActivity]: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=false 0} changed=false
  Application terminated.
  </code></pre>