tags:

views:

47

answers:

0

Hi I want to pass complex data structures from my Service class to Activity class.

I create class Serializable :

        class SaveMe implements Serializable {

        private static final long serialVersionUID = 1L;

        static final int test = 1234;

        private int user;

        private String name;

        private double score;


        public SaveMe() {}
    }

And I put it in Bundle

Bundle bundle = new Bundle();
bundle.putSerializable("serializable", new SaveMe());

HOW can I send this information to Activity class ?

I try with this code :

Intent mapIntent = new Intent(INTENT_MAP);     
mapIntent.putExtras(bundle);

And than I want to send to BroadcastReciver using:

 sendBroadcast(mapIntent);

But I receive force error!

Should I use BroadcastReceiver to pass this data structure to my activity?

How to send to another activity?

Thanks