【发布时间】:2017-02-08 03:38:44
【问题描述】:
我正在我的系统上安装一个 apk,它通过 adb shell 运行良好:
am start -a android.intent.action.MAIN -n com.example.example/.MainActivity
但是,屏幕上不会显示可供手动选择的图标。我想知道这是否是我构建 apk 时选择的选项。当我安装不是我自己的 apk 时,它们的图标会显示。我安装使用:
adb install -r app-release.apk
下面是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.opengl">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Tell the system this app requires OpenGL ES -->
<uses-feature
android:glEsVersion="0x00030000"
android:required="true" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Leanback">
<activity
android:name=".MainActivity"
android:banner="@drawable/app_icon_your_company"
android:icon="@drawable/app_icon_your_company"
android:label="@string/app_name"
android:logo="@drawable/app_icon_your_company"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Snapshot"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>
【问题讨论】:
-
您的清单是什么样的?你是如何安装 apk 的?
-
我已经附上了我的 AndroidManifest.xml ;;;安装方式: adb connect adb devices #ensure connection adb install -r app-release.apk adb shell am start -a android.intent.action.MAIN -n com.example.example/.MainActivity
-
嗯。这是在设备上还是模拟器上?它在其他模拟器上的行为是否相同?另外,如果您从
.MainActivity活动标签中删除android:icon属性会怎样? -
我同时使用物理设备和模拟器,两者的行为相同。如果我删除该属性没有任何变化 - 我相信当我使用默认电视格式开始项目时这是一个残余。
-
您使用的是什么启动器应用程序?还有你为什么用
android.intent.category.LEANBACK_LAUNCHER而不是android.intent.category.LAUNCHER
标签: android android-studio adb android-tv