小编Tim*_*ton的帖子

Android TV无法启动正确的活动

我有一个应该在手机和电视上运行的应用程序.在清单中,我正在指定手机的启动活动

<activity
    android:name=".view.phone.MainActivity"
    android:launchMode="singleTop"
    android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)

和电视的发布活动

<activity
    android:name=".view.leanback.MainActivity"
    android:launchMode="singleTop"
    android:label="@string/app_name"
    android:screenOrientation="landscape" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    </intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)

它不是在LAUNCHER和LEANBACK_LAUNCHER之间进行过滤,而是在清单中首先声明的任何活动.我有什么想法我做错了吗?

android android-manifest android-tv

9
推荐指数
1
解决办法
1106
查看次数

AppCompat Snackbar不以平板电脑为中心

我正在尝试显示一个快餐栏(通过appcompat)向用户显示一条消息.它在手机上运行得非常好,但是在我得到的平板电脑上

肖像

景观

我用来生成小吃店的代码是

Snackbar.make(mHomeContainer, R.string.rate_snackbar, Snackbar.LENGTH_LONG)
        .setAction("Rate", ...)
        .show();
Run Code Online (Sandbox Code Playgroud)

任何关于如何使这个小吃店居中的指导将非常感激

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <View
        android:id="@+id/status_bar"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="@color/main"
        android:elevation="8dp"/>

    <include layout="@layout/toolbar" />

    <RelativeLayout
        android:id="@+id/home_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/main_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentBottom="true" />

        <ListView
            android:id="@+id/home_search_list"
            android:visibility="gone"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#88000000"/>

    </RelativeLayout>
</LinearLayout>

<include layout="@layout/navigation_list" />

</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

android android-appcompat material-design

7
推荐指数
1
解决办法
2419
查看次数

WebView getScrollY()始终返回0

我试图使用webview的滚动位置来确定SwipeRefreshLayout是否应该能够刷新,除了一些网站,例如https://jobs.lever.co/memebox,getScrollY()总是返回0.有没有办法确保我会总是得到正确的滚动位置?

android android-webview

6
推荐指数
2
解决办法
3430
查看次数

Android Geocoder获得管理区域的简称

使用谷歌地图API时,对于管理区域,它会为您提供长名称和短名称,例如.

{
    "long_name": "Victoria",
    "short_name": "VIC",
    "types": [
        "administrative_area_level_1",
        "political"
    ]
}
Run Code Online (Sandbox Code Playgroud)

然而,当使用android的原生地理编码器时,我只获得了长名称(在本例中为"Victoria").有没有办法在Android中获得管理区域的简称,缺少整合谷歌地图地理编码API?

android google-geocoder google-geocoding-api

4
推荐指数
1
解决办法
2319
查看次数

为什么我的Google Play排名如此之低?

我最近发布了针对黑客新闻的纱线.当我在谷歌游戏商店搜索"黑客新闻"时,它列出了第65个项目,尽管列表中有更多的评论和更高的评级.它也支持标题中没有"黑客"或"新闻"字样的项目,从未经过审核或评级<= 1的项目,或者未经过多年更新的项目.

我无法理解为什么它的排名如此之低,或者我能做些什么来解决它.任何见解将不胜感激.

编辑:虽然不是一个编程问题,但似乎没有一个更相关的堆栈交换来问这个

android google-play

-3
推荐指数
1
解决办法
1345
查看次数