Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - getStringExtra from Intent Returns Null

getStringExtra from Intent Returns Null

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

getStringExtra from Intent Returns Null

Postby gmsk19 » Thu Dec 17, 2009 8:39 am

Hi All,
I am using AlarmManager to schedule Events on a Particular time . I Use Intents for this purpose and i set some Extra Information using putExtra method.
The Event is Triggered at the Time Selected. However when i Use getStringExtra in the onReceive Method of my BroadcastReceiver subclass the value returned is null; Can anyone tell what i am missing??

Here is my code:
//From Actvity

Intent intent = new Intent(this, AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(this,
REQUEST_CODE, intent, 0);
intent.putExtra("USERNAME", "jimi");
String temp = intent.getStringExtra("USERNAME"); //returns "jimi" works here
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
firstTime, 24*60*60*1000 , sender);

..
..

//My Receiver Class Code

public class AlarmReceiver extends BroadcastReceiver{

@Override
public void onReceive(Context context, Intent intent) {

String name = intent.getStringExtra("USERNAME"); //returns null :(
}
}
Warm Regards,
Shashi Kiran G M
gmsk19
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Dec 17, 2009 8:32 am
Location: Bangalore

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests