コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_earthquake_summary);

    final Injection injection = new EarthquakeInjection();
    injection.linkInstance(this, MasterViewController.class);
    injection.linkInstance(
        mMessageRepresentationHandler = new MessageRepresentationHandler(),
        IMessageRepresentationHandler.class);
    mMessageRepresentationHandler.setMasterViewController(this);
    mMessageRepresentationHandler.showLoading();
    injection.link();

    new Handler()
        .postDelayed(
            new Runnable() {
              @Override
              public void run() {
                MasterBusinessController mbc = injection.resolve(MasterBusinessController.class);
                mbc.startApp();
              }
            },
            50l);
  }
コード例 #2
0
  @Override
  public void finish() {
    if (mMessageRepresentationHandler != null) {
      mMessageRepresentationHandler.hideLoading();
      mMessageRepresentationHandler.hideMessage();
    }

    if (mPresentedViewControllers != null) {
      mPresentedViewControllers.clear();
      mPresentedViewControllers = null;
    }

    new Handler(Looper.getMainLooper())
        .postDelayed(
            new Runnable() {
              @Override
              public void run() {
                EarthquakeMVC.super.finish();
              }
            },
            150l);
  }