Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7795403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:03:47+00:00 2026-06-01T23:03:47+00:00

I have a problem with the current implementation of my app. I execute an

  • 0

I have a problem with the current implementation of my app. I execute an asynctask onActivityCreated but I’m not interested in doing this if the user simply changes the orientation of the phone. What is the proper way of making sure that unnescesarry asynchronous calls aren’t made when the user changes the orientation of the phone?

Here are the two methods onActivityCreated and populateList. populateList is called onPostExecute().

    @Override
public void onActivityCreated(Bundle savedInstanceState) 
{

    super.onActivityCreated(savedInstanceState);


    userControl = new UserController(getSherlockActivity());
    lv = (ListView)getView().findViewById(R.id.callforwardlist);
    lv.setTextFilterEnabled(true);

    list = new ArrayList<HashMap<String,String>>();

    callForwardList = new SimpleAdapter( 
            getSherlockActivity(), 
            list,
            R.layout.callforward_items,
            new String[] { "line1","line2" },
            new int[] { R.id.callforward_item_text, R.id.callforward_number } );

    new PullInfoTask().execute();

    lv.setAdapter( callForwardList );

    lv.setOnItemClickListener(new OnItemClickListener() {
   // *snip*

  });

}



    private void populateList() 
{

    cfinfo = userControl.GetCallForwardInfo();

    if(Integer.parseInt( cfinfo[0]) == 1)
        addItem("Viderestilling altid", cfinfo[1]);
    else
        addItem("Viderestilling altid", "Slået fra");
    if(Integer.parseInt(cfinfo[2]) == 1)
        addItem("Viderestilling ved optaget", cfinfo[3]);
    else
        addItem("Viderestilling ved optaget", "Slået fra");
    if(Integer.parseInt(cfinfo[4]) == 1)
        addItem("Viderestilling ved intet svar", cfinfo[5]);
    else
        addItem("Viderestilling ved intet svar","Slået fra");

    // Timeout Item
    addItem("Timeout",cfinfo[6]);

      callForwardList.notifyDataSetChanged();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:03:48+00:00Added an answer on June 1, 2026 at 11:03 pm

    There is an easy way to stop that using,

    android:configChanges="orientation" declare this attribute in Manifest file for that Activity.

    Adviceable is that to not to use this and handle orientationChange by yourself in code.

    using onRetainNonConfigurationInstance() for a complete tutorial you can go through this Blog. also read here on developer site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with obtaining the current user location. Code at first works
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I have a problem with the Google App Engine JDO implementation that I cannot
I have been thinking about this problem for long enough but cannot come up
The following code summarizes the problem I have at the moment. My current execution
I have worked many projects with no problems. But in current project, I tested
I am aware that System.Threading.Timer exists, but I already have a Thread. This thread
Ok so I have been trying to fix this for days, and I'm not
Our current product is based on Eclipse RCP. We are starting to have problems
I have problem creating new instance of excel 2007 using VBA (from Access 2002).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.