private void simpleNotify(String ticker , String title, String content, String subText){ NotificationCompat.Builder builder = new NotificationCompat.Builder(MyService.this); builder.setTicker(ticker); builder.setContentTitle(title); builder.setContentText(content); builder.setSubText(subText); builder.setContentInfo("2"); builder.setNumber(2); builder.setAutoCancel(true); builder.setSmallIcon(R.mipmap.ic_launcher); builder.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher)); Intent intent = new Intent(MyService.this,MainActivity.class); PendingIntent pIntent = PendingIntent.getActivity(MyService.this,1,intent,0); builder.setContentIntent(pIntent); builder.setDefaults(NotificationCompat.DEFAULT_SOUND); Notification notification = builder.build(); NotificationManager manager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(1,notification); }
func QueryUnescape func QueryUnescape (s string ) ( string , error ) QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits. func QueryUnescape func QueryUnescape (s string ) ( string , error ) QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits.
评论
发表评论