简体   繁体   English

应用未在设备上显示

[英]App doesn't show up on device

So I'm learning android programming and everything is going well, until I came to this problem. 因此,我正在学习android编程,并且一切进展顺利,直到遇到这个问题。 I'm using android studio and transfer my app to my phone, this has worked well until now. 我正在使用android studio并将我的应用转移到我的手机上,到目前为止效果很好。 The app start automatically and works fine, but when I go back to the home screen on my phone the app is not there, it's not saved on my phone. 该应用程序会自动启动并运行正常,但是当我返回手机的主屏幕时,该应用程序不存在,则不会保存在手机中。 The problems is the same when using the emulator. 使用仿真器时,问题是相同的。

anyone know this problem? 有人知道这个问题吗?

Most probably you need a line in the android manifest that tells us that the app will appear in the launcher. 最可能您需要在android清单中显示一行,告诉我们该应用程序将出现在启动器中。

Check this link out : https://groups.google.com/forum/m/#!topic/android-developers/csokbhepUG0 检查此链接: https : //groups.google.com/forum/m/#!topic/android-developers/csokbhepUG0

In your manifest, add this to your main activity: 在清单中,将其添加到您的主要活动中:

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

You probably already have the MAIN action on the activity, you just need to add the category <category android:name="android.intent.category.LAUNCHER" /> so that it shows up on the launcher. 您可能已经对该活动执行了MAIN操作,您只需要添加类别<category android:name="android.intent.category.LAUNCHER" /> ,即可在启动器上显示。

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

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