我已通过以下代码生成了本地通知。
<?PHP
$con=
"(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = your_ip)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = database_name)
)
)";
$conn = ocilogon( "User_name", "password",$con,"WE8ISO8859P15");
$query = "Select * from tablename";
$parseresults = ociparse($conn, $query);
ociexecute($parseresults);
while($row=oci_fetch_assoc($parseresults))
$output[]=$row;
print json_encode($output);
oci_free_statement($parseresults);
oci_close($conn);
?>
图标icon_loli是16 * 16的白色图标。仍然为21以下的api版本,它工作得非常好,但在棒棒糖和&amp;上面会显示如下图所示的通知
答案 0 :(得分:0)
这是因为setSmallIcon()
,并且材料设计只有黑色和白色,因为主要目的是在顶部栏中显示穿制服的图标。如果您需要徽标,则必须使用setLargeIcon()
,如:
Notification notification = new Notification.Builder(context)
.setAutoCancel(true)
.setContentTitle("title")
.setContentText("message")
.setWhen(System.currentTimeMillis())
.setSmallIcon(getNotificationIcon())
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
.build();