android+图标闪烁动画,如何在android中闪烁通知图标? [DONE]
我找到了解決方案:我創(chuàng)建了動(dòng)畫(huà)文件并設(shè)置了該文件,感謝我找到了解決方案
SET FILE名稱(chēng)在這里: –
int icon = R.drawable.animationfile;
long when = System.currentTimeMillis();
notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(icon, "Your location is tracing", when);
String title = context.getString(R.string.app_name);
Intent notificationIntent = new Intent(context, Home.class);
// set intent so it does not start a new activity
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, title, "Rohit", intent);
//notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.defaults = Notification.DEFAULT_ALL;
notificationManager.notify(NOTIFICATION, notification);
我創(chuàng)建了這個(gè)文件
animationfile.xml:
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
總結(jié)
以上是生活随笔為你收集整理的android+图标闪烁动画,如何在android中闪烁通知图标? [DONE]的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: c语言一行黑白相间的瓷砖,C语言编程练习
- 下一篇: android pjsip 2.5编译,