Re: [android-developers] Problem in Asynctask Execution in standby mode

2012-01-19 Thread Somasundaram Sekar
Yes there is some thing called Wake Lock which you need to acquire and
release as per your need

On Thu, Jan 19, 2012 at 8:00 PM, TreKing  wrote:

> On Thu, Jan 19, 2012 at 7:47 AM, sktniran wrote:
>
>> my application getting force closed. it says like
>> IllegalStateException. how to solve this probelm?
>>
>
> What's the stack trace?
>
>
>> it is there any way to prevent screen from locking untill complete this
>> download process?
>>
>
> Maybe, but that should not be necessary.
>
>
> -
> TreKing  - Chicago
> transit tracking app for Android-powered devices
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem in Asynctask Execution in standby mode

2012-01-19 Thread TreKing
On Thu, Jan 19, 2012 at 7:47 AM, sktniran wrote:

> my application getting force closed. it says like
> IllegalStateException. how to solve this probelm?
>

What's the stack trace?


> it is there any way to prevent screen from locking untill complete this
> download process?
>

Maybe, but that should not be necessary.

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Problem in Asynctask Execution in standby mode

2012-01-19 Thread Somasundaram Sekar
Async Task are UI Threads, probably that's the reason.. try creating
Threads from any bound Services to perform the download and retreive the
download status from service and update that in the UI whenever required..

On Thu, Jan 19, 2012 at 7:17 PM, sktniran wrote:

> Hi friends,
>
>I am using AsyncTask concept to download data from
> server.
>
>  private class DownloadTask extends AsyncTask
> {
>private ProgressDialog progressDialog;
>
> @Override
> protected void onPreExecute()
> {
>super.onPreExecute();
>progressDialog = new ProgressDialog(ActivityTab.this);
>progressDialog.setProgress(10);
>progressDialog.setSecondaryProgress(32);
>
>  progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
>progressDialog.setMessage("Downloading...");
>progressDialog.show();
> }
>
> protected String doInBackground(Void... params)
> {
> String result=" ";
> result = download();
> return result;
> }
>
> protected void onPostExecute(String result)
> {
> if(progressDialog.isShowing())
>progressDialog.dismiss();
>Toast.makeText(getApplicationContext(),"
> "+result.toString(),Toast.LENGTH_LONG).show();
> }
> }
>
>
> in download button click i called
>  new DownloadTask().execute();
>
>
> This is working well. the thing is if device goes to standby mode
> (Screen goes off) while showing this downloading.. progressbar mean my
> application getting force closed. it says like IllegalStateException.
> how to solve this probelm? it is there any way to prevent screen from
> locking untill complete this download process?  please help me.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Problem in Asynctask Execution in standby mode

2012-01-19 Thread sktniran
Hi friends,

I am using AsyncTask concept to download data from
server.

 private class DownloadTask extends AsyncTask
 {
private ProgressDialog progressDialog;

 @Override
 protected void onPreExecute()
 {
super.onPreExecute();
progressDialog = new ProgressDialog(ActivityTab.this);
progressDialog.setProgress(10);
progressDialog.setSecondaryProgress(32);

progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("Downloading...");
progressDialog.show();
 }

 protected String doInBackground(Void... params)
 {
 String result=" ";
 result = download();
 return result;
 }

 protected void onPostExecute(String result)
 {
 if(progressDialog.isShowing())
progressDialog.dismiss();
Toast.makeText(getApplicationContext(),"
"+result.toString(),Toast.LENGTH_LONG).show();
 }
 }


in download button click i called
  new DownloadTask().execute();


This is working well. the thing is if device goes to standby mode
(Screen goes off) while showing this downloading.. progressbar mean my
application getting force closed. it says like IllegalStateException.
how to solve this probelm? it is there any way to prevent screen from
locking untill complete this download process?  please help me.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en