NotifService.java 文件源码

java
阅读 43 收藏 0 点赞 0 评论 0

项目:BatteryModPercentage 作者:
@Override
protected void onPreExecute() {
    b = new NotificationCompat.Builder(context);
    nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    Intent resultIntent = new Intent(context, MainActivity.class);

    resultPendingIntent =
            PendingIntent.getActivity(
                    context,
                    0,
                    resultIntent,
                    PendingIntent.FLAG_UPDATE_CURRENT
            );

    b.setAutoCancel(false)
            .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.icon))
            .setSmallIcon(R.drawable.ic_battery_mgr_mod)
            .setPriority(NotificationCompat.PRIORITY_MIN)
            .setContentIntent(resultPendingIntent)
            .setOngoing(true)
    ;

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号