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

  • SEARCH
  • Home
  • 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 6153013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:01:18+00:00 2026-05-23T20:01:18+00:00

My app uses HoneyComb fragments where my left side panel has listview and right

  • 0

My app uses HoneyComb fragments where my left side panel has listview and right side panel has a MapView with some TextViews.Initially i wrote map view in the map_fragment_right_side.xml which resulted in freezing the screen for long time ,so I decided to inflate the map view at runtime in an AsyncTask in vain .The code goes like this

class LoadMapTask extends AsyncTask<String, Void, Boolean>
{

    MapView inflatedMapView = null;

    @Override
    protected void onPreExecute() {

        progressbar.setVisibility( View.VISIBLE );

    }


    @Override
    protected Boolean doInBackground(String... params)
    {


        try{

        inflatedMapView = new MapView(getActivity(),getActivity().getResources().getString(R.string.mapkey));

        addMapViewhere.addView(inflatedMapView);


        inflatedMapView.getController().setCenter(getPoint(Double.valueOf(latitude),Double.valueOf(longitude)));

        inflatedMapView.getController().setZoom(17);

        inflatedMapView.setBuiltInZoomControls(true);

        sites=new SitesOverlay();

        inflatedMapView.getOverlays().clear();

        inflatedMapView.getOverlays().add(sites);

        }catch (Exception e) {
         e.printStackTrace();
        }


        return true;

    }

    @Override
    protected void onPostExecute(Boolean res)
    {
        if( progressbar != null )
        {
            progressbar.setVisibility( View.GONE );
        }






    }

}

I doubt whether its possible to inflate map view from non-UI thread .I will be glad if someone suggest me the right way to do this.I don’t want the screen to freeze until map gets loaded.
thanks,
ganesh

  • 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-05-23T20:01:18+00:00Added an answer on May 23, 2026 at 8:01 pm

    Inflate it from onPreExecute() or in onPostExecute()

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

Sidebar

Related Questions

I've got a Honeycomb app that uses fragments and an action bar. I'd like
My app uses an API from an external JAR file. This JAR file has
My app uses Facebook Javascript SDK authorization on client side, and for authorized user
Our app uses the send method to call functions on our objects. Unfortunately, some
my app uses the RecognizerIntent to record the user's voice and doing some speech
Our app uses Rails.cache in the controller to cache some items outside the scope
My App Uses Coredata and Displays Data in a table, one column has a
My app uses spring+hibernate+mysql. Some of my tables are growing very big and horizontal
My app uses some bitmaps with a SurfaceView. For bitmaps that a recalled often
My app uses Handler and sendEmptyMessageDelayed to get timed messages that produce debug output.

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.