CREATE NOTIFICATION:

agosto 16, 2018 doido 2.0 0 Comments



Notification.Builder mBuilder = new Notification.Builder(MainActivity.this);
mBuilder.setSmallIcon(R.drawable.con_download); mBuilder.setContentTitle(_title);
mBuilder.setContentText(_text); if (_p) {mBuilder.setProgress(100, 0, true);}
mBuilder.setColor(Color.rgb((int)_rot,(int)_gelb,(int)_blau)); NotificationManager
notificationManager = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify((int)_number,
mBuilder.build()); new Thread ( new Runnable(){ @Override public void run(){ int incr; for(incr =
0; incr <= (int)_max; incr += (int)_by){ mBuilder.setProgress((int)_max, incr, false);
notificationManager.notify((int)_number, mBuilder.build());
try{Thread.sleep((int)_speed);}catch(InterruptedException e){}}
mBuilder.setContentText(_text2).setProgress(1,1,false);
notificationManager.notify((int)_number,mBuilder.build()); }}).start();

0 Comments: