当前位置:网站首页>Simple use of notification
Simple use of notification
2022-06-24 02:28:00 【User 8671053】
Notification Use of different versions
//RemoteViews yes Notification Internal layout of
RemoteViews rv = new RemoteViews(getPackdgeName(),R.layout.rv);
rv.setTextViewText = " Downloading ";
rv.setImageResource(R.id.img,R.drawable.img);// Set up Notification Pictures of the
rv.setProgressBare(R.id.notiProgressbar, 100, 0, false);
Notification notification = new Notification();// The way the outdated version is written
notification.tickerText = " Start the download ";
notification.icon = R.drawable.ic_laucher; // Must add here , Or the back RemoteViews It doesn't work
notification.flag = Notification.FLAG_AUTO_CANCEL; // Automatically clear after clicking
PendingIntent pendingIntent = PendingIntent.getAcitivity(this,0,new Intent(this,MainActivity.class),0);
notification.contentView = rv;
notification.contentIntent=pendingIntent; // Click on Notification Jump
NotificationManager nm = (NotificationManager)getSystemService(NOTIFIACTION_SERVICE);
// When customizing the display status
noti.setLatestEventInfo(this,contentTitle,contentText,0);
nm.noti(notificationId,noti);
// The new version is written
Notification notification = new Notification.Builder(this).setContentIntent(pendingIntent).setContentTitle(" Download complete ").setContentText(" Smile pass ").setSmallIcon(R.drawable.img);// Also here icon Must be set otherwise RemoteViews It doesn't work
notification.contentIntent = rv; // Customize the status of the display
nm.noti(notificationId,noti);</pre> 边栏推荐
- How to build your own website? Is it difficult?
- Does the cloud game server only provide one player? Cloud game server defense capability
- How to design and make ppt gradient effect?
- Dry goods collection | the heaviest content collection of Tencent digital ecology Conference!
- Must the company domain name have a trademark registration? What if the registered domain name is rejected?
- November 1 global network security hotspot
- If you accidentally make the disk dynamic, how to convert it back (do not guarantee it, but take a snapshot before operation)
- Can cloud computing scale flexibly? What are the characteristics of elasticity?
- What is a private VLAN? Eight part essay with pictures and texts.
- Where is the domain name filed? What materials are required for domain name filing?
猜你喜欢

If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations

application. Yaml configuring multiple running environments

Introduction to development model + test model

2020 language and intelligent technology competition was launched, and Baidu provided the largest Chinese data set

BIM model example
Cloudpods golang practice

Advanced BOM tool intelligent packaging function

How to fill in and register e-mail, and open mass mailing software for free

Leetcode969: pancake sorting (medium, dynamic programming)

163 mailbox login portal display, enterprise mailbox computer version login portal
随机推荐
Operation and maintenance platform tcapulusdb transaction management
Flink practice tutorial: getting started 1- zero basic users realize simple Flink tasks
Using robot framework to realize multi platform automated testing
[supply chain • case] Tianneng group: the key to understanding the leading battery manufacturer to achieve the first profit fault
Flowable get the input stream of the current task process picture
Some tips for using uitextview
If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations
Start tcapulusdb process
Centeros environment setup
How does easynvr call the interface to modify a user-defined page?
Is a trademark domain name useful? How long does it take to register a domain name?
What are the conditions for trademark registration? How long does it take to register a trademark?
Start tcapulusdb process
Tornado code for file download
Introduction to development model + test model
Leetcode838: push domino (medium)
Go language starts again, go modules' past life, present life and basic use
Tencent Ding Ke: the mission of Tencent security is to safeguard the beauty of digital
Data backup is required for manual upgrade of WordPress website program
The technical route is based on UE4 for secondary development