我的Andr​​oid应用程序未显示在应用程序的抽屉?应用程序、我的、抽屉、oid

2023-09-14 00:00:55 作者:女神经你值得拥有

我做了一个短信应用程序,但它的安装时,它不会出现在应用程序的抽屉(你从主屏幕上启动应用程序位)!我可以证实它实际上是安装,因为我可以从意图从其他程序和图标/名称,甚至会出现在设置下的管理应用程序启动啦!一旦启动了整个应用程序的功能,因为它要(我甚至用它作为默认发送短信的选项!),所以我不认为它的​​任何与我的java文件,我有一种感觉它的东西与我的Android清单:

I've made an sms application but when it's installed it does not appear on the app drawer (the bit where you launch applications from on the home screen)! I can confirm it is actually installed because i can launch it from intents from other programs and the icon/name even appears in 'manage applications' under settings! Once launched the whole app functions as it should (I even get the option to use it as default for sending sms!) so i don't think its anything to do with my java files, I have a feeling its something to do with my android manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.pearson.sms"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.SEND_SMS">
</uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS">
</uses-permission>
<uses-permission android:name="android.permission.READ_SMS">
</uses-permission>
<uses-permission android:name="android.permission.WRITE_SMS">
</uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".DisplaySMSRecieved"
          android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <data android:scheme="sms" /> 
    </intent-filter>
    <intent-filter>
            <action android:name="com.pearson.sms.LAUNCH" />  
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
</activity>
<receiver android:name=".PearsonSMSReciever"> 
    <intent-filter> 
        <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="sms" /> 
    </intent-filter> 
</receiver>
<activity android:name=".PearsonSMS"
          android:label="@string/send_sms">
          <intent-filter>
        <action android:name="android.intent.action.SENDTO" />
        <action android:name="android.intent.action.VIEW" />  
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="sms"/> 
    </intent-filter>
  </activity>
 </application>
</manifest>

这是一个有点乱,我挣扎,使其作为一个适当的SMS应用工作,但我看不到我做了什么错,使之不列出自己的应用程序的抽屉,请大家帮忙!

It's a bit of a mess as I was struggling to make it work as a proper sms application, but I can't see what I've done wrong to make it not list itself on the app drawer, please help!

编辑:排序,它是意图过滤器

sorted it, it was the intent filter

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

它不应该有机器人:计划在那里,我改成了

it shouldn't have the android:scheme in there, i changed it to

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

和现在被列在应用程序的抽屉:)

and it now gets listed in the app drawer :)

推荐答案

您可以尝试删除你的第一个意图过滤器的DisplaySMSRecieved数据录入。出现在启动,你需要有一个意图过滤器,如:

You could try removing the data entry from your first intent filter for DisplaySMSRecieved. To appear on the launcher you need to have an intent filter like:

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

请确保您指定你的包的图标和名称,以便它可以显示在列表中。

Make sure you have specified an icon and a name for your package so that it can be displayed in the list.