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

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 - Attempt to share objects between activities [SOLVED]

Attempt to share objects between activities [SOLVED]

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

Attempt to share objects between activities [SOLVED]

Postby sandis84 » Mon Oct 26, 2009 10:30 am

Edit Warning: Problem solved, it was a typo in the code, lol.

I tried to share objects by having a global hashmap in my first activity, Activity1:

public static HashMap<String, Object> sharedObjects;

then in my second activity I run for example:

Activity1.sharedObjects.get("ImportantObject");

But I get a nullpointerexception.

Following other discussions Im getting the idea that this should work and be the best way to share objects, see for example:
http://groups.google.com/group/android- ... c47cc5bbd8

Obviously I am doing something wrong. The strange thing is that I can access the static hashmap from Activity1, but not from Activity2.

edit: LOL, i forgot to create the static object. It should ofcourse be:
public static HashMap<String, Object> sharedObjects = new HashMap<String, Object>();

Maybe this thread can still help people who are trying to share objects between activities, thought. =)
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 4 guests