notification without pending intent

后端 未结 1 1535
广开言路
广开言路 2021-01-04 06:05

I need to create a notification,which will display in the top but it should not navigate to any page,should not have any onclick function.

here is the code which i h

1条回答
  •  别那么骄傲
    2021-01-04 06:08

    Use Intent wihtout having component, like below

    PendingIntent contentIntent = PendingIntent.getActivity(
        getApplicationContext(),
        0,
        new Intent(), // add this
        PendingIntent.FLAG_UPDATE_CURRENT);
    

    This is provide a way where use can't open an Activity.

    0 讨论(0)
提交回复
热议问题