Buggy code:
public class CustomXGMsgReceiver extends XGPushBaseReceiver { @ Override public void onRegisterResult ( Context context , int i , XGPushRegisterResult xgPushRegisterResult ) { } @ Override public void onUnregisterResult ( Context context , int i ) { } @ Override public void onSetTagResult ( Context context , int i , String s ) { } @ Override public void onDeleteTagResult ( Context context , int i , String s ) { } public void onTextMessage ( Context context , XGPushTextMessage xgPushTextMessage ) { Log . i ( "virgil" , "----CXG<seq2seq4repair_space>text<seq2seq4repair_space>message<seq2seq4repair_space>----" ) ; Log . i ( "virgil" , ( "title:" + ( xgPushTextMessage . getTitle ( ) ) ) ) ; Log . i ( "virgil" , ( "content:" + ( xgPushTextMessage . getContent ( ) ) ) ) ; Log . i ( "virgil" , ( "custom<seq2seq4repair_space>content:" + ( xgPushTextMessage . getCustomContent ( ) ) ) ) ; try { MediaPlayer mediaPlayer = MediaPlayer . create ( MyApplication . getInst ( ) . getApplicationContext ( ) , notification ) ; mediaPlayer . start ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; Log . e ( "CustomXGMsgReciever" , "virgil" , e ) ; } String title = xgPushTextMessage . getTitle ( ) ; String content = xgPushTextMessage . getContent ( ) ; if ( title . equals ( URL_GET_ASSIGN_ORDER ) ) { try { JSONObject jsonObject = new JSONObject ( content ) ; JSONObject dataObj = jsonObject . getJSONObject ( "data" ) ; final String user_id = UtilHelper . getSharedUserId ( ) ; final String order_id = dataObj . getString ( "order_id" ) ; final String status = dataObj . getString ( "d_status" ) ; Intent orderIntent = new Intent ( ) ; orderIntent . setClass ( MyApplication . getInst ( ) . getApplicationContext ( ) , orderMainActivity . class ) ; orderIntent . putExtra ( "user_id" , user_id ) ; orderIntent . putExtra ( "order_id" , order_id ) ; orderIntent . putExtra ( "status" , status ) ; orderIntent . putExtra ( "from" , "XG" ) ; if ( ( UtilHelper . iHandleXGMessage ) != null ) { iHandleXGMessage . getMessage ( user_id , order_id , status ) ; } PendingIntent pendingIntent = PendingIntent . getActivity ( MyApplication . getInst ( ) . getApplicationContext ( ) , UUID . randomUUID ( ) . hashCode ( ) , orderIntent , FLAG_UPDATE_CURRENT ) ; <START_BUG> Notification notification = new Notification . Builder ( MyApplication . getInst ( ) . getApplicationContext ( ) ) . setSmallIcon ( logo_icon ) . setTicker ( "您有新的配送单，请尽快确认" ) . setContentTitle ( ( "您有新的配送单号" + order_id ) ) . setContentText ( "请在5分钟内确认" ) . setContentIntent ( pendingIntent ) . getNotification ( ) ; <END_BUG> notification . defaults |= Notification . DEFAULT_VIBRATE ; notification . flags |= ( Notification . FLAG_AUTO_CANCEL ) | ( Notification . DEFAULT_SOUND ) ; NotificationManager notificationManager = ( ( NotificationManager ) ( MyApplication . getInst ( ) . getSystemService ( NOTIFICATION_SERVICE ) ) ) ; notificationManager . notify ( 1 , notification ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } @ Override public void onNotifactionClickedResult ( Context context , XGPushClickedResult xgPushClickedResult ) { } @ Override public void onNotifactionShowedResult ( Context context , XGPushShowedResult xgPushShowedResult ) { } }

Fix:
Notification notification = new Notification . Builder ( MyApplication . getInst ( ) . getApplicationContext ( ) ) . setSmallIcon ( logo_icon ) . setTicker ( "您有新的配送单，请尽快确认" ) . setContentTitle ( ( "您有新的配送单号" + order_id ) ) . setContentText ( "请在2分钟内确认" ) . setContentIntent ( pendingIntent ) . getNotification ( ) ;