Android sample application - IncomingMessage

Put your problem here if it does not fit any of the other categories.

Android sample application - IncomingMessage

Postby AndreySerj » Wed Jan 30, 2008 3:51 pm

SDK has IncomingMessage application. Here is a snatch of code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. ....
  3.  
  4.  
  5.  
  6.         // what happens when we click the icon
  7.  
  8.         Intent clickIntent = new Intent(Intent.MAIN_ACTION);
  9.  
  10.         clickIntent.setClass(this, IncomingMessageView.class);
  11.  
  12.  
  13.  
  14.         // construct the Notification object.
  15.  
  16.         Notification notif = new Notification(
  17.  
  18.                             R.drawable.stat_sample,
  19.  
  20.                             getText(R.string.status_bar_notification_title),
  21.  
  22.                             clickIntent, null, null);
  23.  
  24.  
  25.  
  26.  
  27.  
  28.         // send the notification ============================================
  29.  
  30.         nm.notifyWithView(R.layout.incoming_message_panel, view,
  31.  
  32.                 NotificationManager.LENGTH_LONG, notif);
  33.  
  34.     }
  35.  
  36. ....
  37.  
  38.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


After running application, status bar has icon. On click the IncomingMessageView must be shown. But, when I click it nothing happens. Why ?
AndreySerj
Developer
Developer
 
Posts: 31
Joined: Wed Dec 26, 2007 9:57 am
Location: Minsk

Top

Postby plusminus » Wed Jan 30, 2008 8:17 pm

Hello AndreySerj,

when you click it, the Intent you specified should be sent out.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         // what happens when we click the icon
  2.  
  3.         Intent clickIntent = new Intent(Intent.MAIN_ACTION);
  4.  
  5.         clickIntent.setClass(this, IncomingMessageView.class);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

Perhaps you forgot the Activity receiving it (There should be the appropriate message in the LogCat). The easiest would be to define an Intent, you know that it is working.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby AndreySerj » Thu Jan 31, 2008 1:17 pm

Hello plusminus,
I found solution:

PS: I hope this behaviour is an emulator issue... :D
AndreySerj
Developer
Developer
 
Posts: 31
Joined: Wed Dec 26, 2007 9:57 am
Location: Minsk

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 16 guests