有没有关于如何在Android应用程序中设计好的图标放在状态栏作为通知的教程? 理想情况下,我正在寻找一个模板或者一个可以轻松修改的图标。我不是一位设计师。 我需要笑脸状态栏图标。
有没有关于如何在Android应用程序中设计好的图标放在状态栏作为通知的教程? 理想情况下,我正在寻找一个模板或者一个可以轻松修改的图标。我不是一位设计师。 我需要笑脸状态栏图标。
http://hub.buzzbox.com/android-sdk/notification-icons
还有一个Photoshop文件可供下载和修改。
在Android的官方模板包中,也有一个简单的状态栏模板图标。
http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#templatespack
Notification notification = new Notification(R.drawable.asterisk_sign, text, System.currentTimeMillis());
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0); //this is how we will launch an Activity when the user clicks the notification
notification.setLatestEventInfo(this, getText(R.string.app_name), text, contentIntent);
mNM.notify(R.string.minutemaid_service_started, notification); //send the notification to the system, to be displayed in the notification bar
这是一个示例,演示如何在通知栏中创建一个通知,在选择后启动一个活动。