/** * Called when the activity is first created. Retrieves the wufoo form and inserts it into the * view. * * @param savedInstanceState Um I don't even know. Read the Android documentation. */ @Override public void onCreate(Bundle savedInstanceState) { if (android.os.Build.VERSION.SDK_INT >= 11) setTheme(R.style.Default_New); super.onCreate(savedInstanceState); wv = new WebView(this); wv.getSettings().setJavaScriptEnabled(true); wv.addJavascriptInterface(new JavascriptInterface(), "HTMLOUT"); wv.setWebViewClient(new RestoreDraftClient()); FrameLayout fl = new FrameLayout(this); fl.setBackgroundResource(R.color.backClr); fl.addView(wv); setContentView(fl); setTitle(R.string.contact); baconPDialog = Callisto.BaconDialog( ContactForm.this, this.getResources().getString(R.string.loading) + "...", null); baconPDialog.setOnCancelListener( new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // Finish the activity if the fetching is canceled finish(); } }); baconPDialog.setCancelable(true); thatWhichWillReadTheCSS = new ReadCSS(); thatWhichWillReadTheCSS.execute((Void[]) null); }
/** Called when the activity is going to be destroyed. */ @Override public void onDestroy() { super.onDestroy(); wv = null; thatWhichWillReadTheCSS.cancel(true); }