-1

I have a current activity that show some chart data, I want to add google map to be inside the same current activity.

The reason is I want to show the charts or map when button is clicked.If I implement another google map activity once I switch to that activity the main activity will be paused(which I don't want)

Ahmed
  • 93
  • 7

1 Answers1

0

I understood that you want to show only Map or only chart at a time.

It better to handle it with multiple fragments, but as you don't wanted to call onPause(), I feel we can handle it simply with visibility of views, add map and chart to same view group[Relative layout] and handle visibility based on click action.

    <ChartView
        style="@style/MatchParent"/>

        <fragment
            android:id="@+id/map_fragment"
            android:name="com.google.android.gms.maps.SupportMapFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

Please update me if this is not the use case.