Android Phone Screen orientation Asynctask calling again and again

SoundCloud clone for Android and Web
i_rulez
Posts: 53
Joined: Tue Aug 25, 2015 9:37 pm

Android Phone Screen orientation Asynctask calling again and again

Postby i_rulez » Thu Aug 27, 2015 11:29 am

Hi,

I am calling an asynctask in oncreate of the activity, whenever i change the screen orientation of my phone Asynctask is calling again. How can i resolve this??

sagar
Posts: 37
Joined: Mon Aug 24, 2015 11:23 am

Re: Android Phone Screen orientation Asynctask calling again and again

Postby sagar » Thu Aug 27, 2015 12:41 pm

Hi,

you can add this line in your android manifest's activity tag of particular activity so that on screen rotation change activity wont be recreated and your asynctask wont be called again.

Code: Select all

<activity
    android:name=".YourActivityName"
    android:configChanges="orientation|screenSize">
</activity>

i_rulez
Posts: 53
Joined: Tue Aug 25, 2015 9:37 pm

Re: Android Phone Screen orientation Asynctask calling again and again

Postby i_rulez » Mon Aug 31, 2015 12:26 pm

Thank u.. you saved my time..

PaulineCes
Posts: 1
Joined: Fri Dec 11, 2015 2:21 pm

Android Phone Screen orientation Asynctask calling again and again

Postby PaulineCes » Mon Dec 21, 2015 7:18 am

Ah, too bad. Of all choices, Android is the worst one as its cannibalizing the Linux ecosystem. Then again, if youre happy with it...


Return to “SoundStar”

Who is online

Users browsing this forum: No registered users and 0 guests