07-31-2012 05:36 AM
Hi all,
I am storing some data in persistence.this data is large and this process is taking time nearly one minute on phone.
i just want to store data in background thread.When i create a seprate thread for this.It hangs the ui until data is not stored.What should i do.
07-31-2012 05:43 AM - edited 07-31-2012 05:46 AM
Hi vishalkheterpal,
Try to decrease priority for your background thread.
It's also useful to be know how you create the thread.
07-31-2012 06:36 AM
Hi,
Use the following---
new Thread(new Runnable() { public void run() {
//do ur work here
} }).start();
Also make sure that u r not synchronizing for a long process,i mean u r not using synchronized (UiApplication.getEventLock()) in the worker thread.
thanks,
07-31-2012 06:41 AM
rishikeshsinghpbh i am doing the same the ui stills hangs.
07-31-2012 06:54 AM
Hi,
Also make sure that u r not synchronizing for a long process,i mean u r not using synchronized (UiApplication.getEventLock()) in the worker thread.
Thanks