WebShareActivity.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package epson.print;
  2. import android.content.Intent;
  3. import android.os.Bundle;
  4. import androidx.appcompat.app.AppCompatActivity;
  5. /**
  6. * 分享页面
  7. */
  8. public class WebShareActivity extends AppCompatActivity implements CustomTitleDialogFragment.Callback {
  9. protected void onCreate(Bundle bundle) {
  10. super.onCreate(bundle);
  11. setContentView(R.layout.activity_web_share);
  12. checkAndStartNextActivity();
  13. }
  14. private void checkAndStartNextActivity() {
  15. if (((IprintApplication) getApplication()).getPrinting()) {
  16. CustomTitleDialogFragment.newInstance(0, getString(R.string.EPS_PRNST_PRINTING_TITLE), 0, R.string.ok, 0).show(getSupportFragmentManager(), "simple-dialog");
  17. } else {
  18. startWebActivity();
  19. }
  20. }
  21. /**
  22. * 打开web页面
  23. */
  24. private void startWebActivity() {
  25. Intent intent = getIntent();
  26. intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
  27. intent.setClass(this, WebviewActivity.class);
  28. startActivity(intent);
  29. finish();
  30. }
  31. public void onLocalPositiveCallback(int i) {
  32. finish();
  33. }
  34. public void onLocalNegativeCallback(int i) {
  35. finish();
  36. }
  37. }