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 8979167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:47:12+00:00 2026-06-15T19:47:12+00:00

Please see my previous question for details on how it works. Current Setup I

  • 0

Please see my previous question for details on how it works.

Current Setup

I have created a class called SherlockMapFragment inside the ActionBarSherlock(ABS) library which extends SupportMapFragment. This works fine to display the map etc and I didn’t realise until now (because I’m an idiot) the following:

  • I created an instance of SherlockMapFragment called mapFrag.
  • Then to use and display this I call mapFrag.newInstance().

What this is actually doing is returning an instance of SupportMapFragment however this call is necessary to get the MapView displayed.

This is a huge problem for what I am trying to achieve because I am trying to add my Fragments into a tabbed navigation bar but obviously I cannot add a SupportMapFragment to a TabListener because I get all sorts of class cast exceptions etc as its expecting an extension of SherlockFragment or Fragment.

Can anyone see a way round this? Or if I need to make myself clearer please just ask the question.

One Possible Solution

One solution is to create my own tab bar and handle the transaction of Fragments myself. However, the tools are already there and I don’t really want to be doing this if its a simple fix.

Thanks in advance

  • 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-15T19:47:13+00:00Added an answer on June 15, 2026 at 7:47 pm

    You could extends SherlockFragment and handle the MapView yourself. This would look something like…

    public class SherlockMapFragment extends SherlockFragment
    {
    private MapView mapView;
    
    @Override
    public void onActivityCreated(Bundle savedInstanceState)
    {
        super.onActivityCreated(savedInstanceState);
    
        mapView = (MapView) getView().findViewById(R.id.my_map_id);
        mapView.onCreate(savedInstanceState);
    }
    
    @Override
    public void onResume()
    {
        super.onResume();
        mapView.onResume();
    }
    
    @Override
    public void onPause()
    {
        super.onPause();
        mapView.onPause();
    }
    
    @Override
    public void onLowMemory()
    {
        super.onLowMemory();
        mapView.onLowMemory();
    }
    
    @Override
    public void onSaveInstanceState(Bundle outState)
    {
        super.onSaveInstanceState(outState);
        mapView.onSaveInstanceState(outState);
    }
    
    @Override
    public void onDestroy()
    {
        super.onDestroy();
        mapView.onDestroy();
    }
    }
    

    Nothing says you absolutely MUST use SupportMapFragment. One of the coolest parts of the new API is the ability to use the MapView as a normal View.

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

Sidebar

Related Questions

NOTE: Before reading this question please note that I have read the previous questions
Please see my previous question: Eclipse is not working after download I deleted the
I have a program that collects information from the database. in my previous question
So using the advice found in my previous ' question ', I have been
I have a question related to this previous question of mine . In an
NOTE: Please read the whole thing before posting, you'll see why. So I have
I got this question as an assignment: Packages/Naming We have created lot of packages
The servlet spec (see my previous question) guarantees that the same thread will execute
Please see demo here: http://jsfiddle.net/mA6qm/1/ (expand console) Why aren't events being sent or received
Please see here , at the end of the post, the 70px author image

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.