Java 如何在我的应用程序图标中添加小部件计数?
我需要在我的android应用程序中添加一个“我的应用程序”图标上的通知计数,但我不知道如何创建,我已经创建了我的小部件,但我如何才能在屏幕上的应用程序图标上准确显示它 我需要在通知到达时显示它,我已经完成了所有的工作! 那是我的小部件Java 如何在我的应用程序图标中添加小部件计数?,java,android,eclipse,Java,Android,Eclipse,我需要在我的android应用程序中添加一个“我的应用程序”图标上的通知计数,但我不知道如何创建,我已经创建了我的小部件,但我如何才能在屏幕上的应用程序图标上准确显示它 我需要在通知到达时显示它,我已经完成了所有的工作! 那是我的小部件 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" andr
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlayout"
android:layout_width="54dp"
android:layout_height="54dp"
android:background="@null"
android:orientation="vertical" >
<ImageView
android:id="@+id/icon"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="0dp"
android:contentDescription="@drawable/shapecount"/>
<TextView
android:id="@+id/txtCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@drawable/shapecount"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:text=""
android:textColor="#FFFFFF"
android:textSize="12sp"
android:textStyle="bold" />
</RelativeLayout>
您是否试图在用户主屏幕上的图标上添加通知计数,如iOS的小“徽章”?或者这是针对您的某个活动中的应用程序图标(例如,在ActionBar上)?是的,我正在尝试在用户主屏幕上的图标上添加通知计数,如iOS!这不是Android所支持的。有些定制的启动程序应用程序可能会在某些项目上显示徽章,但通常是未读消息或未接来电的数量,因为这些信息可以通过Android SDK中的API获得。