Hello Friends, I am developing some application, in that I have
implemented notification for message receiving. but when I click on
notification it doesn't show desired intent. the code for that is as
under.

public void notifyUser(String str, Context context, long receivedSms)
{
String convertedStr = "abc";
NotificationManager noteManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification note = new Notification(R.drawable.icon,
"Message Received", System.currentTimeMillis());
note.defaults = Notification.DEFAULT_LIGHTS;
Intent showSms = new Intent();
showSms.setAction("android.intent.action.MAIN"
showSms.addCategory("SMSRECEIVER"
PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
showSms, 0);
if (receivedSms == 1) {
note.setLatestEventInfo(context, "SMS in Lango", convertedStr,
contentIntent);
} else if (receivedSms > 1) {
note.setLatestEventInfo(context, "SMS in Lango", Long
.toString(receivedSms + 1)
+ " Messages unread", contentIntent);
}
notificationVar = true;
noteManager.notify(R.layout.buddy_list, note);
}

Is there any problem in code???
The manifest file code for particular class as under.

<receiver android:name=".SmsReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED"
class=".BuddyListActivity"/> />
</intent-filter>
</receiver>

Log Message:
07-15 23:23:28.636: INFO/ActivityManager(564): Starting activity:
Intent { action=android.intent.action.MAIN categories={SMSRECEIVER}
comp={com.lango.sms/com.lango.sms.SmsReceiver} }
07-15 23:23:28.986: WARN/InputManagerService(564): Window already
focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@4367da28

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to