내 앱에서 알림을 수신 중이며 로그에서 볼 수 있습니다. 그러나 일부 휴대 전화에서는 표시되지 않습니다. 예 : One plus A0001 (Android 5.1.1 API22). 다른 stackoverflow 질문을 읽고 필요한 모든 메서드가 있는지 확인했습니다. 일부 탐험 후에 Cyanogenmod가이 문제의 원인인지 알게되었습니다. 앱 알림이 표시됩니다.일부 Android 휴대 전화에 알림이 표시되지 않습니다.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = new Intent(this, MainActivity.class);
PendingIntent pIntent = PendingIntent.getActivity(this, (int) System.currentTimeMillis(), intent, 0);
Notification n = new Notification.Builder(this)
.setContentTitle("New mail from " + "[email protected]")
.setContentText("Subject")
.setSmallIcon(R.drawable.ic_launcher)
.setContentIntent(pIntent)
.setAutoCancel(true).build();
NotificationManager notificationManager =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(6578, n);
}
위의 코드는 다른 모든 모바일에서 작동합니다.
'NotificationCompat'을 사용해보세요. 한번 해봐. – Wizard
@Wizard 이미 시도했습니다. 하지만 아무 쓸모가 없어 –