android - Asynctask cancelled when interstitial ad shown -


My app has an asynchronous process that runs a process in the background to load a website and information about it again During this time I show a loading dialog.

The process is underway, I show an interstitial (full screen) ad.

Edit: When this ad is shown (not necessarily when pressed X), app cancels my acnectscak

I do not want to cancel advertising to cancel my accessory.

  Private Class Loan Operation Async Tasks and LTs; Object, void, string & gt; {Progressive dialogue dialog; @ Override protected string doInBackground (object ... parameter) {try {log d. (TAG, "parsing website ..."); ArrayList & LT; String & gt; Link = new arreelist & lt; String & gt; (); Link = bridge link (string) param [1]); Configuration config = new configuration (); Config.setLocalStoragePath (string) parameter [0]); // Desktop Versions only config.setBrowserUserAgent ("Mozilla / 5.0 (Windows NT 6.1; WOW64) Apple WebKat / 537.4 (Chrome / 22.0.122 9.94 Safari / 537.4"); Swan Hans = New Hans (Config) Article Article = Hoose ExtraContent (links.get (0)) return article. Adhesive article ();} hold (exception e) {// TODO auto generated blocking block e.printStackTrace ();} return "" ;} @ Override Protected Zero on postexec (string webtext) {// rotation set Log in (Orientation SCREEN_ORIENTATION_UNSPECIFIED); log.I (tag, "executed"); if (webText.equals ("") handleSendText (UNSUPPORTED_WEBSITE); else handendext (webtext); dialog.dismiss (); super.onPostExecute (Webtext);} Prerequisites (Prerequisite) on the override protected zeros (Talaorientation); Dialog = progressivity.Show (PasteActivity.This, "Add", "Getting articles from website, please wait ...", True, True, new communication interface. {Override public zero} {on the {@Concal (Dialogue Interface dialog)} { Dismiss the dialog (); Long Operation Task Consul (True); Set-up Orientation (activity inf. SCREEN_ORIENTATION_UNSPECIFIED);}}); dialog.setCancelable (incorrect); } @ Override canceled at zero protected () {Toast. Make Text (Paste Activity. This, "Cancel Cancellation.", Toast. LNNHTHRART). Show (); dialog.dismiss (); } @ Override protected void progress update (zero ... value) {}}   

another edit: add:

  dialog.setCanceledOnTouchOutside (wrong );   

It is not done properly either.

Edit: Removing:

  Long OperationTask. Cancel (true);   

It is not done properly either.

EDIT: So I realized that interstitial ads actually call (on my activity) and on my ON, I cancel my work. I am trying to cancel the ontop () function instead. But it is not ideal.

Update: Either it does not fix it. But once the advertisement is canceled, the work is going on. However after a few seconds it is still canceled.

I believe your asyncTask is your activity AsyncTask example is probably a feature of your activity - otherwise we will tell you how they are connected to each other, we can help) Thus when you have lost the AsyncTask context (such as by your activity again (tax setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) (garbage-collected) And this command AsyncTask Moving around the orientation changes the pattern is shown in the pattern stops being kept to keep.

My suggestions (The way this is done, though it is a bit old, in case you are using pieces , but it is simple and works ).

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -