/** {@inheritDoc} */ @Override protected void onDestroy() { super.onDestroy(); final Intent intent = new Intent(this.connector.getPackage() + Connector.ACTION_CAPTCHA_SOLVED); final String s = ((EditText) this.findViewById(R.id.solved)).getText().toString(); if (s.length() > 0) { Log.d(TAG, "solved: " + s); intent.putExtra(Connector.EXTRA_CAPTCHA_SOLVED, s); } intent.setFlags(intent.getFlags() | Intent.FLAG_INCLUDE_STOPPED_PACKAGES); Log.d(TAG, "send broadcast: " + intent.getAction()); this.sendBroadcast(intent); }
/** {@inheritDoc} */ @Override public void onCreate(final Bundle savedInstanceState) { this.setTheme(PreferencesActivity.getTheme(this)); super.onCreate(savedInstanceState); Log.d(TAG, "onCreate();"); final Bundle extras = this.getIntent().getExtras(); if (extras == null) { this.finish(); return; } this.connector = new ConnectorSpec(this.getIntent()); if (this.connector == null) { this.finish(); return; } this.setContentView(R.layout.captcha); this.setTitle(this.connector.getName() + " - " + this.getString(R.string.captcha_)); this.getSupportActionBar().setHomeButtonEnabled(true); WebSMSApp.fixActionBarBackground( this.getSupportActionBar(), this.getResources(), R.drawable.bg_striped, R.drawable.bg_striped_img); final Parcelable p = extras.getParcelable(Connector.EXTRA_CAPTCHA_DRAWABLE); if (p != null && p instanceof Bitmap) { ((ImageView) this.findViewById(R.id.captcha)).setImageBitmap((Bitmap) p); } else { this.finish(); return; } final String t = extras.getString(Connector.EXTRA_CAPTCHA_MESSAGE); if (t != null) { ((TextView) this.findViewById(R.id.text)).setText(t); } this.findViewById(R.id.ok).setOnClickListener(this); this.findViewById(R.id.cancel).setOnClickListener(this); }