@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_upload_status);

    choiceFormat = new ChoiceFormat(getString(R.string.rate_choice));
    rateNumberFormat = new DecimalFormat(getString(R.string.rate_number_format));

    progressBar = (ProgressBar) findViewById(R.id.progress_bar);
    progressPercent = (TextView) findViewById(R.id.progress_percent);
    uploadRate = (TextView) findViewById(R.id.upload_rate);

    Uri filePath = getFilePath();

    setTitle(getString(R.string.uploading_s, filePath.getLastPathSegment()));

    // First-time start.
    if (UploadStatusObservables.getObservable(filePath) == null && savedInstanceState == null) {
      logger.info("Uploading {}", filePath);

      progressBar.setIndeterminate(true);

      UploadStatusObservables.createSubject(filePath);

      Bundle extras = checkNotNull(getIntent().getExtras());
      if (extras.getBoolean(EXTRA_START_SERVICE, true)) {
        String contentType =
            checkNotNull(
                extras.getString(EXTRA_CONTENT_TYPE), EXTRA_CONTENT_TYPE + " extra is null");
        Intent finishedIntent = checkNotNull((Intent) extras.getParcelable(EXTRA_FINISHED_INTENT));

        Intent serviceIntent =
            UploadService.createMyIntent(this, filePath, contentType, getIntent(), finishedIntent);
        startService(serviceIntent);
      }
    } else {
      logger.info("There's already upload of the same file in progress: {}", filePath);
    }
  }