package epson.print;

import android.content.Intent;
import android.os.Bundle;


public class WebShareActivity extends AppCompatActivity implements CustomTitleDialogFragment.Callback {
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView((int) R.layout.activity_web_share);
        checkAndStartNextActivity();
    }

    private void checkAndStartNextActivity() {
        if (((IprintApplication) getApplication()).getPrinting()) {
            CustomTitleDialogFragment.newInstance(0, getString(R.string.EPS_PRNST_PRINTING_TITLE), 0, (int) R.string.f343ok, 0).show(getSupportFragmentManager(), "simple-dialog");
        } else {
            startWebActivity();
        }
    }

    private void startWebActivity() {
        Intent intent = getIntent();
        intent.setFlags(335544320);
        intent.setClass(this, WebviewActivity.class);
        startActivity(intent);
        finish();
    }

    public void onLocalPositiveCallback(int i) {
        finish();
    }

    public void onLocalNegativeCallback(int i) {
        finish();
    }
}
