Android的 - 移除谷歌地图碎片的onPause并添加回onResume [英] Android - Remove Google Maps Fragment onPause and add back onResume

查看:228
本文介绍了Android的 - 移除谷歌地图碎片的onPause并添加回onResume的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要删除谷歌地图的片段上活动的onPause事件,并添加回onResume事件。我怎样才能做到这一点?

I need to remove Google map fragment on Activity onPause event and add it back onResume event. How can i do this ?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/mapContainer"
    tools:context=".MainActivity" >

    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>

因此本 Android的后退按钮很慢

Accordingly to this Android Back button very slow

需要它<一个href="http://stackoverflow.com/questions/16262328/android-performance-issue-tabhost-timer-setcurrenttab-google-maps-api-v">Android性能发出─TabHost - 定时器 - SetCurrentTab() - 谷歌地图API V2

Need it for Android Performance Issue- TabHost - Timer - SetCurrentTab() - Google Maps Api V2

编辑:

其实我做到了。但是,仍然有一个延迟的问题。如何才能停止/关闭意图在后面堆栈?

编辑:

同时我现在想删除和添加回片段请参阅本 - > <一个href="http://stackoverflow.com/questions/16275349/android-add-supportfragment-and-get-it-back-from-its-tag-null">Android-Add SupportFragment并取回从它的标签 - &GT; NULL

Also i'm now trying to remove and add back fragment please see this -> Android-Add SupportFragment and get it back from it's tag - > NULL

推荐答案

我刚刚删除TabView的。这真是快now.If你担心在这样的情况我的表现,我建议你删除tabhost,只是使用新意图()。

I've just removed tabview. It's really fast now.If you are worrying about performance in a situation like mine, I suggest you to remove tabhost and just use new Intent().

这篇关于Android的 - 移除谷歌地图碎片的onPause并添加回onResume的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆