小编use*_*322的帖子

android检查位置服务启用播放服务位置api

您可以确定是否有任何提供程序可用于LocationManager,但是可以使用google play services location api完成吗?

当没有被启用,其实"访问我的位置"功能关闭,所有的API调用(连接(),requestLocationUpdates())成功,但你永远不会得到一个onLocationChanged().

看起来很傻,必须同时使用LocationManager和LocationClient.

我想我需要的是一些知道onLocationChanged的方法(0 永远不会被调用.

android location google-play-services

25
推荐指数
2
解决办法
1万
查看次数

如果最初设置为invisble,则不会显示android setVisibility

我有一个glsurface占据全屏幕.点击一个按钮,我想要出现另一个布局(设置类型的东西).如果我从覆盖图开始可见,我可以使其不可见,然后再次可见,没有任何问题.但是,如果我从它开始看不见,我不能让它再次可见.代码如下:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

    <android.opengl.GLSurfaceView
    android:id="@+id/glPlaySurface"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</android.opengl.GLSurfaceView>

<RadioGroup
    android:id="@+id/radioGroup1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:orientation="horizontal" >

    <RadioButton
        android:id="@+id/btnRotate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:checked="true"
        android:text="R"
        android:textColor="#000" />

    <RadioButton
        android:id="@+id/btnPan"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:text="P"
        android:textColor="#000" />
</RadioGroup>

<Button
    android:id="@+id/btnLights"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_marginLeft="15dp"
    android:layout_toRightOf="@+id/radioGroup1"
    android:text="Lights" />

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layoutLights"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:visibility="visible" <--- Does not work if set to invisible
    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"

    android:background="#fff" >

    <Button
    android:id="@+id/btnLightsOK"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="15dp"
    android:text="OK" />

    <Button
    android:id="@+id/btnLights"
    android:layout_width="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

layout android visibility

20
推荐指数
4
解决办法
3万
查看次数