- * BroadcastReceiver that updates {@link #resultTextView}
- *
- * @author Marius Gavrilescu <marius@ieval.ro>
- */
- private final class LoginReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(@Nullable final Context context, @Nullable final Intent intent) {
- if(intent==null)
- return;
- resultTextView.setText(intent.getStringExtra(BroadcastResultCallback.EXTRA_RESPONSE_MESSAGE));
- final int responseCode=intent.getIntExtra(BroadcastResultCallback.EXTRA_RESPONSE_CODE, 0);
- if(responseCode>=200&&responseCode<300)
- resultTextView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tick, 0, 0);
- else
- resultTextView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.cross, 0, 0);
- }
- }
-
- /**
- * Implementation of <code>ResultCallback</code> that broadcasts a {@link #LOGIN_BROADCAST}