title: getting "getTextBeforeCursor on inactive InputConnection" warn message
body: <p>Here is a code snippet from DeviceAdminReceiver subclass implemented by me:-</p>
  
  <pre><code>public void onDisabled(Context context, Intent intent) 
  {
      super.onDisabled(context, intent);
  
      AntiTheftApplicationContext.setApplicationContext(
          context.getApplicationContext());
  
      final Context applicationContext =  AntiTheftApplicationContext.
          getApplicationContext();
  
      Thread thread = new Thread(new Runnable() 
      {
          @Override
          public void run() 
          {
              applicationContext.stopService(new Intent(applicationContext,    AuthenticationWakeupCallReceiver.class));
  
              applicationContext.startService(new Intent(applicationContext, AuthenticationWakeupCallReceiver.class));
  
          }
      });
  
      thread.start();
  
      while(AntiTheftUtil.isMyServiceRunning(
             AuthenticationWakeupCallReceiver.class.getName()))
      {
          try 
          {
              Thread.sleep(20000);
          } 
          catch (InterruptedException e) 
          {
              e.printStackTrace();
          }
       }
  }
  </code></pre>
  
  <p>AuthenticationWakeupCallReceiver starts another activity i.e PostStartupAuthenticationActivity :-</p>
  
  <pre><code>if(!PostStartupAuthenticationActivity.isActivityRunning())
  {
      Intent intent = new Intent(context,XYZ.class);
  
      intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  
      context.startActivity(intent);
  }
  </code></pre>
  
  <p>XYZ activity contains an EditText which is defined as follows in layout file :-</p>
  
  <pre><code>&lt;EditText
      android:id="@+id/re_enter_authentication_code"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="enter authentication code"
      android:inputType="textPassword"
      android:maxLines="1"
      android:singleLine="true" /&gt;
  </code></pre>
  
  <p>Handling for EditText is done as follows in my code:-</p>
  
  <pre><code>final EditText dataEnteredEditText = (EditText)findViewById(R.id.re_enter_authentication_code);
  
  TextWatcher watcher = new TextWatcher() 
  {
      int countAttempts = 0;
  
      @Override
      public void onTextChanged(CharSequence enteredText, int start, int before, int count) 
      {
          String value = enteredText.toString();
  
          if(value.length() &gt;= authenticationCode.length() &amp;&amp;       !value.equals(authenticationCode))
          {
              dataEnteredEditText.setError("Invalid Code!!!");
  
              dataEnteredEditText.setText(AntiTheftConstants.EMPTY_STRING);
  
              countAttempts++;
  
              if(countAttempts == 3)
              {
                  SharedPreferences.Editor editor = sharedPref.edit();
  
                  editor.putBoolean(AntiTheftConstants.USER_AUTHENTICATION_STATUS, false);
  
                  editor.commit();            
  
                  startProcessForAuthenticationFailure();
  
                  finish();
  //          }
          }
          else if(value.equals(authenticationCode))
          {
              mIsCorrectPasswordEntered = true;
  
              stopService(new Intent(AntiTheftApplicationContext.getApplicationContext(), AuthenticationWakeupCallReceiver.class));
  
              stopService(new Intent(AntiTheftApplicationContext.getApplicationContext(), AuthenticationWakeupCallReceiver.class));
  
              notifySuccessfulAuthentication();
         }
      }
  }
  </code></pre>
  
  <p>Problem 1 :-
  But when XYZ is invoked from AuthenticationWakeupCallReceiver, EditText defined in XYZ activity stops accepting numbers. When i am entering simple letters it is being accepted but when i am entering numbers it is not getting accepted. I am getting following warning message :- "getTextBeforeCursor on inactive InputConnection".</p>
  
  <p>Problem 2:-
  I am looking for a better approach I want to invoke an activity from DeviceAdminReceiver subclass without starting a different thread for checking running status of my service. can i start my activity without starting a separate thread. I just want to block control flow till user is being validated. onDisabled method in DeviceAdminReceiver subclass should only complete execution when user is validated properly.</p>