简体   繁体   English

android无法打开我的应用

[英]android cannot open my app

I have built the .apk for a little application I wrote for android. 我为我为android编写的一个小应用程序构建了.apk。 On the installation finished screen the "Open" option is grayed out and can not be chosen. 在安装完成屏幕上,“打开”选项显示为灰色,无法选择。 After when I search the device for the application no icon appears, if I check installed apps it is there but still cannot be opened. 当我在设备上搜索应用程序后,没有图标出现,如果我检查已安装的应用程序,它就在那里,但仍然无法打开。 I believe this is a problem with the androidmanifest.xml. 我相信这是androidmanifest.xml的一个问题。 I have very little experience with the androidmanifest and mostly just work with java. 我对androidmanifest的经验很少,而且大多只是使用java。

<application

    android:allowBackup="true" android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher" android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name">
        <intent-filter>
          <action android:name="android.intent.action.MAIN"/>
          <category android:name="andriod.intent.category.LAUNCHER"/>
            </intent-filter>







        </activity>





</application>

Above is my manifest, I understand my manifest probably has many errors so thank you for your help and patients in advance. 以上是我的清单,我明白我的清单可能有很多错误,所以请提前感谢您的帮助和患者。

is this a typo ? 这是一个错字吗?

intent-filter>
      <action android:name="android.intent.action.MainActivity"/>
        </intent-filter>

it should be like this 它应该是这样的

<intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

The default launcher intent: 默认启动器意图:

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Your intent-filter is wrong, that's the reason why android won't create an icon. 你的意图过滤器是错误的,这就是android不会创建图标的原因。 Just have a quick Google lookup or create a new project and copy the intent-filter out of the Manifest. 只需快速查找Google或创建新项目,然后将意图过滤器从Manifest中复制出来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM