asynctask

How should I use Executor insteand of AsyncTask or IntentService for queueing task on Android?

Is it a good solution or not? How to implement? When should I shutdown properly? I shutdown it onDestroy() in the Activity, then relaunch my app as soon as possible. It causes a java.util.concurrent.RejectedExecutionException, why? Does anyone know its lifecycle? Any idea? Thanks. ...

hibernate 'open session in view' and asynchronous tasks

I'm utilizing the Open Session in View pattern for my jsf/icesfaces application. As usual a servlet filter is opening and closing all the hibernate sessions at the beginning and the end of a "web server thread". My problem now is that I'm using asynchronous tasks for eg. loading big lists of objects from the database. Therefore I'm crea...

problem with calling invalidate in async task thread in Android !

Hi Everyone, I am trying to call the invalidate() from asyntask thread. I am getting this error : 10-18 15:14:30.469: ERROR/AndroidRuntime(889): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. The line I have used is : mainClass.myMapV...

Android: TabActivity - add no Tabs before AsyncTask has finished

I've got an TabActivity implementing TabContentFactory, which starts an AsyncTask in onCreate() to fetch the data for the tabs. When the AsyncTask has finished, onPostExecute() could directly update the UI-elements, right? Meaning, since that method runs in the UI-Thread no further thread-synchronization would be required when accessing ...

What is wrong with this code?

Sorry that I'm asking such a question, but I'm tryin to make this one run for hours, and I'm not finding the mistake... public class Main extends ListActivity { /** Called when the activity is first created. */ ProgressDialog dialog; @Override public synchronized void onCreate(Bundle savedInstanceState) { super.onCreate(savedInsta...

Going from runnable to asynctask

I was trying to get my method running in background using Asynctask, but using sample from the book for a basis the only thing I get is crashed application. At moment I am using this code: private Handler mHandler = new Handler(); private Runnable mUpdateTimeTask = new Runnable() { public void run() { Location location = tra...