Android :: AsyncTask.cancel - True - Work

Apr 20, 2010

Cause it doesn't.I have a service running an Asynctask to do some work. I bind to it from an activity and call a cancel method. The service, in turn, calls AsyncTask.cancel(true);

AyncTask.cancel returns true. Nonetheless, the thread is still running happily and still doing the things in doInBackGround, sending notifications along the way.

There is no sign that it attempted to kill the thread. I am not using NDK calls or anything that I think should stop if from taking down the thread. What am I doing wrong? Or is this a known issue?

Android :: AsyncTask.cancel - true - work


Android :: AsyncTask's Cancel Method - Possible Bug?

Jul 26, 2010

As far as I can tell, AsyncTask's cancel method doesn't work as advertised. I can't tell whether this is a bug, or me not understanding AsyncTask's cancel() method. I'm asking here instead of StackOverflow because I suspect it's a bug.

I understand from past discussions here that cancel() isn't meant to actually kill a thread (though the description of the mayInterruptIfRunning flag sure implies it is). But I'm also checking for isCancelled() (which is returning false), and trying to use the onCancelled callback (which isn't getting called), to no avail.

My situation is that I have a (short-running, one small network call) AsyncTask that begins in my Activity's onCreate. If the user backs out of the screen before it finishes though, I need to either cancel the AsyncTask entirely, or at least make sure its onPostExecute doesn't do any meaningful work.

In my activity's onDestroy handler, I call cancel() on the task, and then inside the task I have an onCancelled handler that sets a boolean. In my onPostExecute handler, I check isCancelled(), and I also check to see whether the boolean has been set from onCancelled, and neither are.

I'm using the debugger, and the order of operations is:

1) onDestroy(), calls task.cancel() 2) task's onPostExecute runs, isCancelled() returns false, so I have no conditional to stop the flow and that's it. onCancelled never runs.

What am I doing wrong here? I can't find any way to tell my task not to run its work in onPostExecute.

View 7 Replies View Related

Android :: True VoIP Applications That Work

Sep 24, 2010

I have been looking around today and am trying to find a VoIP application that will actually work.

Let's say, what if I got my phone shut off from VZW, would there be a way to make VoIP calls over wifi? I have seen posts about using Google Voice in conjunction with other programs. Also, Nimbuzz? Anyone have a positive approach they have used for this?

I will be going out of the US for a while and will be getting my VZW account inactive for a while. I am looking for a way in which I'll be able to still use my Droid Incredible to make calls to the US using wifi. I'd even be willing to make calls just to Skype friends or Nimbuzz friends. I am hoping that someone else has found a way to accomplish this.

View 13 Replies View Related

Android :: Use AsyncTask To Show ProgressDialog While Doing Background Work

Oct 8, 2010

I am developing my first Android App and I need a ProgressDialog to be showed while a background task, in this case just a http call on the server, happens.

I did a bit of studying on this and also have already checked other threads related to this subject.

http://developer.android.com/reference/android/os/AsyncTask.html

[url]

[url]

[url]

Among others.

Than I got to write a bit of code:

1) In My Activity I declare a variable to be of type ProgressDialog

code:............

2) I have also written an inner class to extend AsyncTask as required, here in the doInBackGround is where I call a static method which actually do the POST http request to the server, in the server side I have blocked the server response 20s to validate the progress dialog.

code:............

3) When the button is pressed I than build the ProgressDialog anc call the AsyncTask I have created:

code:...................

Well, this is it, I believe this was suppose to show a progress dialog while the AsyncTask would query the server in background, but what I get is NO progress bar until server response arrives and than for a fraction of time(less than 1 second) the progress shows and the next Activity is called.

View 2 Replies View Related

Android :: Instance Variable Of Activity Not Being Set OnPostExecute Of AsyncTask - Return Data From AsyncTask

Jul 28, 2010

I'm trying to figure out the correct way to create an AsyncTask to retrieve some data from the internet and then to take that data and bundle it up in an Intent and pass it to a new activity(A list display). So in the first activity I just have an EditText and Button. In the event of an OnClick the task should be called and when it is finished the data should be bundled inside an Intent and passed to the next Activity. The problem is when I take the results from onPostExecute and set them to an instance variable of the main activity, that instance variable is still null when the task is complete. Here is the barebones version of the code:

CODE:...........

When I debug the application I see onPostExecute does contain a valid PlacesList full of results, so why is the instance variable places set to null after the task is executed? I am going about "returning data" from an AsyncTask incorrectly?

View 1 Replies View Related

Android :: True SAX Parser

Oct 12, 2010

I am trying to implement a robust RSS/Atom reader for android, and since Xerces won't compile I am struggling to find an alternative. I am using org.xmlpull.v1.sax2.Driver(), however this just wraps a DOM parser with SAX callbacks. Is there anything comparable to Xerces on Android?

View 3 Replies View Related

Android :: True VOIP App

Feb 4, 2010

I got a mytouch 3g figuring it would handle voip like iphone and wm phones. But to my dismay, it appears there are no true VOIP apps for android that will allow me to call over wifi/3G from Germany.

I have read about sipdroid, truphone, skype lite, iscoot and others, but they all make a local call first, even to members of the same service -totally defeats the purpose. You'd be better off using a calling card!!

Anyway, just wondering if I am missing something. I got an android phone because I wanted to be part of something different, with great potential. I just didn't realize that it would be different in such a disadvantageous way...

View 5 Replies View Related

Android :: Layout_alignParentBottom - True On Code

Oct 28, 2010

I have a tab widget i need to make it appear at the bottom of the screen, however i need to set the property android:layout_alignParentBottom="true", but this widget is created on code. How can i set this propety to True on code side (not on xml side)

View 2 Replies View Related

Android :: Used Uses Library Option True?

Aug 12, 2010

I am trying to make an app that can work with or without the Google Maps API present. Eclipse gives me an error when trying to use android:option as an attribute (I have the latest SDK, I think, revision 6). Also, when I set the build target without the Google Maps library, I get an error from my class that extends MapActivity.

View 10 Replies View Related

Android :: Determining Phone Looking At True North

May 11, 2010

I looked over SensorManager and was still unsure, how do I detect if the phone is looking at true north (or any other direction for that matter).

View 1 Replies View Related

Android :: FastScrollEnabled - True - Is More To Getting Alphabetical Index?

Jan 28, 2010

I added android:fastScrollEnabled="true" to the xml description of my listview class. I was (probably mistakenly) expecting this to magically transform the scrolling of my really huge listview so that the thumb button and the indexes display on the right side.

Is there more to hooking up the listview so that the framework knows what its alphabetizing? I have custom defined cells.

View 3 Replies View Related

General :: True Android Lock Screen App?

Mar 14, 2012

I am coming from Windows Mobile 6.5 and was using PocketShield as my lock screen replacement. One thing that I am looking for in an android app is..

1. The ability to enter pin or pattern from the lock screen app while also displaying all the new features of the app. One screen to rule them all.

2. I now use WidgetLocker and it works great except that I have to enter the pattern after sliding my app. What is the point? Either I enter the pattern before I select the app from the home screen or after when sliding. I thought I was able to use the app on the slicker "outside" of pattern security.

View 1 Replies View Related

Android :: Assign EditText - SingleLine - True Programmatically

Oct 30, 2009

How can you programmatically set the android:singleLine="true" property of a TextView?

I want my EditText to open a numeric keypad with the "Done" button.

View 2 Replies View Related

Android :: Layout When Setting WindowIs Floating To True?

Mar 3, 2010

I've got a ListActivity using the Theme.Dialog theme and windowNoTitle set to true.

Unfortunately, when I do this, the header rows (just normal rows in the list but they look like sub headers) refuse to fill_parent width (instead, they wrap_content - the header text).

I noticed this was not a problem when using the Theme theme so I started narrowing everything down to what was causing the problem.

The answer: windowIsFloating. Theme.Dialog sets this to true, and if I override this to false, then the headers happily fill the parent width.

Is there a way around this (because I would like to set windowIsFloating to true)?

View 8 Replies View Related

Android :: Layout Zoom Control With SetBuiltInZoomControls(true)?

Nov 20, 2009

would like to add a zoom control to the map. I also want to layout the position of the zoom Control instead of the default middle bottom position. I can do this by getZoomControl but it is deprecated.

Could anyone tell me how to do this with setBuildtInZoomControls?

View 5 Replies View Related

Android :: AllowTaskReparenting - True Will There Be A Single Instance Of The Activity

Oct 4, 2009

Before asking my doubt, let me clarify my understanding of allowTaskReparenting...

Suppose there exists a Task (say Task 1) and this task has an activity (say Activity 1) which wants to call my Activity (say Activity 2). Let my activity (activity 2) set the attribute allowTaskReparenting to true and let my activity have a specific taskAffinity(affinity1). When Activity1 calls my activity (activity2), my activity becomes part of the task1. But suppose another task (task2) is already present/created with the same taskAffinity as mine (affinity1) and an activity in that task (say activity3) tries to start my activity, my activity gets re- parented to task2.

Not sure if i was clear enough. If i were to rephrase my words...

If my activity has allowTaskReparenting set to true and an instance of my activity is already present in task1. If task2 with the same task affinity as my activity tries to start my activity, the EXISTING activity gets re-parented from task1 to task2.

My quesions:

(1) Is my understanding correct ?

(2) If I am correct then a single instance of my activity gets shifted from task1 to task2. So 2 activity objects of my activity are NOT created.

View 5 Replies View Related

Android :: Achieve True Gapless Playback - Can't Seem To Improve

Jan 30, 2009

When using a mediaplayer to play back an audio file, you can set looping to true - that's not the issue here.

If looping is set to true, there's still an audible gap between the file finishing and then starting again.

How could I achieve true gapless playback? I've attempted using two instances of the same file, overriding oncomplete and onseek.. can't seem to improve the gap though.

View 6 Replies View Related

Samsung Moment :: Need ROM To Improve True-GPS Performance?

Sep 30, 2010

I'm dying here with the 5 minute (non-aGPS assisted) fix times and frequent losses of fix.

View 6 Replies View Related

Android : How To Cancel A Connection?

Jun 30, 2009

How to cancel a connection?

View 5 Replies View Related

Android : How Can I Cancel Old Alarm?

Jul 2, 2010

i am using a unique value (primary ID) to set an alarm. When i want to edit the alarm i am using the same key. But what i see is that both the alarms go off! original as well as edited one. how do i cancel the old alarm ?

View 2 Replies View Related

Sony Ericsson Xperia X10 :: I Get Beeping Instead Of True Ringtone

Aug 30, 2010

I'm having a problem with my X10 ringtone. Instead of the normal ringtone I have set up and has been working normally since I started using the phone, I now get a horrible quick-beeping notification tone whenever I receive a call/text. have tried going into Settings>Sound&Display and re-selecting the appropriate ringtones and notifications but this makes no difference. I still get the fast beeping as my alert tone. When I check what tone is selected, my current tones are still set.Has anyone else had this problem and resolved it? I'm at my wits end what to do and would appreciate your expertise and suggestions.

View 1 Replies View Related

Motorola Droid X :: True AOSP Fission Beta

Oct 14, 2010

[ROM]FRF91 AOSP Fission - Beta Preview - Droid Forum - Verizon Droid & the Motorola Droid Forum

Saw this posted, has anyone tried it out yet?

Seems a lot like RubX, made from same person I believe.

View 15 Replies View Related

HTC Incredible :: Can't Get Weather App To Show My True Current Area

May 18, 2010

After going out of town this weekend where my Incredible switched my "current location" to where I was, upon returning home the Incredible still shows that I'm in the other location. I've tried updating and such. I've even tried rearranging the areas (towns/cities). I've tried to delete the towns/cities. It still says I'm in the other city and nothing changes in the "first place/home screen" after rearranging/deleting.

View 2 Replies View Related

Android :: How To Cancel All Alarm Created By App?

May 30, 2010

I am making an event application and user can set a reminder for events he wants. So i use the alarmManager to create alarms. I would like to put a cancel all option to my main activity so that i could cancel all the alarms created by my application. The usual method for canceling the alarm with the same intent doesnt really help cause i set tha alarms on a different activity than the one I want to cancel them in. So is there a way to cancel all the alarms created by my application?

View 1 Replies View Related

Android :: Cancel Alarms / Filtering?

Apr 16, 2010

Code below creates an Alarm, so far everything is working fine. But i am a bit lost in the Documentaion how to cancel an Alarm. I need to cancel only special Alarm(s) depending on Intent#putExtra(IntentConstants.SELECTED_PRIMARY_KEY,_selectedID);

How can i archive this ?

CODE:.....................

View 3 Replies View Related

Android :: Cancel This Repeating Alarm?

Jul 25, 2010

I'm writing something like a reminder for users. Users will set reminders for their events, when the time comes, a repeating alarm will be set to trigger a status bar notification. But the alarm seems non-stop after I selected the notification or cleared the notification. I am not sure where to cancel this repeating alarm. Below are some of the codes...

How can I stop the alarm when the user selects the notification or clears it?

View 1 Replies View Related

Android :: How To Stop - Cancel CountDownTimer

Jun 29, 2010

I'm extending the CountDownTimer class to obtain some custom functionality .In onTick() in case some conditions are met I call cancel() , expecting that will be the end of it, however the onTick() callback gets call until the the count down is reached . So how to prevent this from happening ?

View 3 Replies View Related

Android : How To Cancel An OnItemSelected Upon Startup?

Aug 5, 2009

1) I have a Spinner with several options provided by an ArrayAdapter and have an onItemSelected listener on this Spinner. When selecting an item from the spinner, I want to display another view (list-view) but this method is unintentionally invoked upon initially displaying the view. The list-view is therefore displayed upon startup of the application. It is possible to add a spinner-on-item-select listener that won't fire upon initially displaying the view but only by the user selecting an item?

View 2 Replies View Related

General :: Play Store Doesn't Always Give True Results

Aug 22, 2012

Take an app I found on some tech site recommending the app "super download" It is an app that lets you download over 4g and wifi at the same time.

If you go to the play store website and search "super download," you get no results. its as if the app dont exist.

But heres a link to the app on google play: [URL]

My device is compatible with it, its not that.

I've seen this happen with the adobe flash program and a few others.

View 4 Replies View Related

General :: A10 1.5 Tablet - Only Rotate Display And Touch Still In True Direction

Oct 18, 2013

My tablet is Allwinner A10 1.5. Tablet rotate display 180 but the touch is still in the true direction. So I want to rotate the display without rotate touch

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved