The problem in async task when i open my Application i want to copy my all data from internal card to external mmc. the files & folder copy task is running properly but i want it to run in background which may not stuck the screen. but when i open app it runs and copy data but the screen gets stuck. Please help me out in this.
i coded following function under async task.
public class BackGroundProcess extends AsyncTask<String, String, String> // inner class to perform all background process i.e. invisible
{
public BackGroundProcess() {
doInBackground(intPath,extPath);
// TODO Auto-generated constructor stub
}
@Override
public String doInBackground(String... params) {
// TODO Auto-generated method stub
CommonMethods.copyRecursive(intPath, extPath);
return null;
}
and on onCreate() method i am creating the object of class like :-
BackGroundProcess bg = new BackGroundProcess();
but the screen stucks while it copies the data.
Please help me out in this how to get rid of this i want it to run in the back ground with no screen stuck. one more question: using threads is a good idea? if yes kindly guide me thru coz i am new to android.
thanx in advance.
Aucun commentaire:
Enregistrer un commentaire