resultTextView.setText(message);
if(error)
resultTextView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.cross, 0, 0);
- else
+ else {
resultTextView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.tick, 0, 0);
+ startService(new Intent(FonBotMainActivity.this, FonBotMainService.class));
+ }
}
});
}
@Override
public void onResult(final int responseCode, final String responseMessage, final @Nullable InputStream inputStream) {
- if(responseCode!=200 || inputStream==null)
+ if(responseCode != 200 || inputStream==null){
+ if(responseCode != 204)
+ throw new RuntimeException("Bad HTTP response code: "+responseCode);
return;
+ }
final Handler handler=new Handler(Looper.getMainLooper());
@Override
public void onError(final String error) {
Log.e("PollResultCallback", "onError: "+error);
+ throw new RuntimeException(error);
}
}