简体   繁体   English

我的 android 应用程序没有显示在应用程序抽屉中?

[英]My android app is not being displayed in the app drawer?

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:我制作了一个短信应用程序,但是安装后它没有出现在应用程序抽屉(您从主屏幕上启动应用程序的位置)上,我可以确认它确实已安装,因为我可以从其他程序的意图启动它并且图标/名称甚至出现在设置下的“管理应用程序”中:一旦启动整个应用程序就可以正常运行(我什至可以选择将其用作默认发送短信!)所以我认为它没有什么可做的使用我的 java 文件,我感觉它与我的 android 清单有关:

<?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>

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!这有点乱,因为我正在努力让它作为一个适当的短信应用程序工作,但我看不出我做错了什么,使它不在应用程序抽屉上列出,请帮忙!

EDIT: 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它不应该有 android:scheme 在那里,我把它改成

<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:)它现在被列在应用程序抽屉中:)

You could try removing the data entry from your first intent filter for DisplaySMSRecieved.您可以尝试从 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.确保您已为 package 指定图标和名称,以便它可以显示在列表中。

also, you can use double intent-filter like the following one inside your desired activity that uses data此外,您可以在使用数据的所需活动中使用如下所示的双重意图过滤器

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</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's a long shot but is there an icon in the drawable folder?这是一个很长的镜头,但可绘制文件夹中有一个图标吗? You have android:icon="@drawable/icon which tells Android what icon to use in the app drawer. Maybe try putting in your own icon. Also try uninstalling/reinstalling (maybe reboot phone also just to be sure) the app as I've noticed that Android will sometimes cache these icons.你有android:icon="@drawable/icon它告诉 Android 在应用程序抽屉中使用什么图标。也许可以尝试放入你自己的图标。也可以尝试卸载/重新安装(也许重启手机也只是为了确定)我的应用程序'已经注意到 Android 有时会缓存这些图标。

UPDATE更新

What happens when you run it from eclipse and then hold down the HOME button (to get recent apps)?当您从 eclipse 运行它然后按住 HOME 按钮(以获取最近的应用程序)时会发生什么? Does it show up there?它出现在那里吗? Is there an icon?有图标吗?

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

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