当前位置:网站首页>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> 边栏推荐
- Coding -- the leader of R & D tools in the cloud native Era
- Modify the original place where the method needs to be called and triggered
- [supply chain • case] Tianneng group: the key to understanding the leading battery manufacturer to achieve the first profit fault
- Start tcapulusdb process
- DB2 database generates HTML patrol Report
- What is the cloud desktop server configuration? What are the application scenarios of cloud desktop?
- How to set up a cloud desktop server? What are the advantages of cloud desktop?
- Opengl: how to use shader to convert RGBA to nv21 image format? (open source for the first time in the whole network)
- The same set of code returns normally sometimes and reports an error sometimes. Signature error authfailure SignatureFailure
- Hungry? Remote dual live database practice
猜你喜欢

Introduction to development model + test model

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

Leetcode969: pancake sorting (medium, dynamic programming)

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

Advanced BOM tool intelligent packaging function

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

BIM model example

application. Yaml configuring multiple running environments

163 mailbox login portal display, enterprise mailbox computer version login portal
Cloudpods golang practice
随机推荐
Tidb HTAP Getting Started Guide - how to add a copy of tiflash
Layout use case
SQL Server database recovery case analysis
The easydss on demand file upload interface calls postman to report an error. Failed to upload the file?
The technical route is based on UE4 for secondary development
Thoroughly explain the details of the simple factory that you haven't paid attention to
What is ITF barcode
Question: can you get download the resources of Baidu online disk?
Pan micro reached cooperation with Tencent to help enterprises connect with banking services and support enterprise digital upgrading
Modify the original place where the method needs to be called and triggered
Tencent cloud won the first place in the cloud natural language understanding classification task
What information should be provided for enterprise trademark registration? Is it difficult to register a trademark?
Buddha's foot before examination: the first bullet of leetcode
The blue screen will be displayed at a remote location, and the error code kmode will be reported_ EXCEPTION_ NOT_ Handled, the DMP file has the keyword cdd dll
Do you still understand the deadlock handling methods in MySQL performance testing and tuning?
Advanced BOM tool intelligent packaging function
Interesting talk about decorator mode, so you will never forget it
How to solve the problem of uncaught (in promise) when easywasmlayer plays a video?
If you accidentally make the disk dynamic, how to convert it back (do not guarantee it, but take a snapshot before operation)
The whole procurement process of the procurement mall website in the transportation industry is electronic to reduce the procurement cost