के अंदर मेरी सेवा में लंबित इंंटेंट कैसे भेजें I अपनी सेवा बताना चाहता हूं कि यह कार्रवाई करने के बाद क्या करना है। तो मैं सेवा एक PendingIntent
भेजना चाहते हैं, तो यह इसे शुरू कर सकते हैं (PendingIntent.send()
का उपयोग करके)इरादे
PendingIntent pendingIntent;
Intent newInt;
newInt = new Intent(Intent.ACTION_SENDTO);
newInt.setData(Uri.parse("sms:052373"));
newInt.putExtra("sms_body", "The SMS text");
pendingIntent = PendingIntent.getActivity(this, 0, newInt, 0);
अब सवाल यह है कि pendingIntent
pendingIntent
को संलग्न करने के लिए शुरू करने के लिए?
मैं उदाहरण के लिए इस की कोशिश की:
NewIntent.putExtra("pendingIntent",pendingIntent);
startService(NewIntent);
लेकिन यह काम नहीं करता।
और सेवा में:
PendingIntent pendingIntent = (PendingIntent) intent.getParcelableExtra("pendingIntent");
pendingIntent.send();
"लेकिन यह काम नहीं करता है" अपने लक्षणों की एक बेकार वर्णन है। – CommonsWare
धन्यवाद, अगली बार मैं भेजने के लिए अधिक विशिष्ट – Aminadav