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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:24:17+00:00 2026-06-15T09:24:17+00:00

As shown above i have a Fragment Activity which renders two fragements. On the

  • 0

enter image description here

As shown above i have a Fragment Activity which renders two fragements. On the Map Fragment i want to implment and display a Map.

Since we need to extend MapActivity i am not sure how it can be done inside a fragment.

Trying to implement Solution from
(https://stackoverflow.com/a/10739200/1737771)

package com.m7.nomad;

import android.app.LocalActivityManager;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.view.Window;

public class MapsFragment extends SherlockFragment {
    private static final String KEY_STATE_BUNDLE = "localActivityManagerState";
    private LocalActivityManager mLocalActivityManager;

    protected LocalActivityManager getLocalActivityManager() {
        return mLocalActivityManager;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Bundle state = null;
        if (savedInstanceState != null) {
            state = savedInstanceState.getBundle(KEY_STATE_BUNDLE);
        }

        mLocalActivityManager = new LocalActivityManager(getActivity(), true);
        mLocalActivityManager.dispatchCreate(state);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // This is where you specify you activity class
        Intent i = new Intent(getActivity(), GMapActivity.class);
        Window w = mLocalActivityManager.startActivity("tag", i);
        View currentView = w.getDecorView();
        currentView.setVisibility(View.VISIBLE);
        currentView.setFocusableInTouchMode(true);
        ((ViewGroup) currentView)
                .setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
        return currentView;

    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBundle(KEY_STATE_BUNDLE,
                mLocalActivityManager.saveInstanceState());
    }

    @Override
    public void onResume() {
        super.onResume();
        mLocalActivityManager.dispatchResume();
    }

    @Override
    public void onPause() {
        super.onPause();
        mLocalActivityManager.dispatchPause(getActivity().isFinishing());
    }

    @Override
    public void onStop() {
        super.onStop();
        mLocalActivityManager.dispatchStop();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        mLocalActivityManager.dispatchDestroy(getActivity().isFinishing());
    }

}

What should i specify for near

..............
public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // This is where you specify you activity class
        Intent i = new Intent(getActivity(), GMapActivity.class);
        Window w = mLocalActivityManager.startActivity("tag", i);

..................
  • 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-15T09:24:17+00:00Added an answer on June 15, 2026 at 9:24 am

    Take a look at the new Google Maps Android API v2 that was just released. It contains support for fragments (including the support library) and much more.

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

Sidebar

Related Questions

I want to achieve was is shown on the picture above. I have a
On my storyboard (shown above), I have a ViewController which holds an MKMapView with
Suppose multiple Modal Windows shown above each other. All of those have ShowInTaskbar =
I have 2 divs above each others, at a given moment one is shown
I have the following code: function show(){ var a=document.getElementById('somediv').style.display; a=block; } The above code
I want show annotation view (above one of my pin) after load map. For
Shown are two scatter charts on the same set of data, which contains some
My setup I have two classes, here shown stripped down to what is needed
As shown image in above I have four tabs below videoview Resume , Produits
I have a main Activity and one fragment . The main Activity has the

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.