मेरे पास एक ऐसी सेवा है जो अधिसूचना तैयार करती है और फिर समय-समय पर कुछ जानकारी के साथ अद्यतन करती है। लगभग 12 मिनट या तो फोन दुर्घटनाग्रस्त हो जाता है और रीबूट हो जाता है, मेरा मानना है कि यह अधिसूचना अपडेट करने के तरीके के साथ निम्नलिखित कोड में मेमोरी रिसाव के कारण होता है, अगर कोई ऐसा मामला है और मुझे सलाह दे तो कृपया मुझे सलाह दें गलत कर रहा हूँअधिसूचना सेवा में एंड्रॉइड मेमोरी लीक
onCreate:
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
createNotification:
private void createNotification() {
Intent contentIntent = new Intent(this,MainScreen.class);
contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent appIntent =PendingIntent.getActivity(this,0, contentIntent, 0);
contentView = new RemoteViews(getPackageName(), R.layout.notification);
contentView.setImageViewResource(R.id.image, R.drawable.icon);
contentView.setTextViewText(R.id.text, "");
notification = new Notification();
notification.when=System.currentTimeMillis();
notification.contentView = contentView;
notification.contentIntent = appIntent;
}
updateNotification:
private void updateNotification(String text){
contentView.setTextViewText(R.id.text, text);
mNotificationManager.notify(0, notification);
}
अग्रिम धन्यवाद।
सही रिबूट – smith324
यह सिर्फ जीसी बड़ा और बड़ा हो रही है जब तक यह समस्याओं का कारण बनता है और मारे गए सामान शुरू होता है और रिबूट – stealthcopter
यकीन है कि यह सुनिश्चित करें कि आपके आवेदन के लिए है से पहले Logcat के कुछ पोस्ट करें। इसे पूरी तरह से अनइंस्टॉल करने का प्रयास करें और देखें कि यह अभी भी होता है या नहीं। हाल ही में स्थापित कुछ अन्य ऐप हो सकता है। – Moncader