0

I'm developing an Android application that use the Alarm Manager.

The application consists of more than one Activity. Anytime the alarm goes off a new Activity is shown. This new activity receives some input from user and then I need to return this data. In more details: I structured my application in the following manner

the onCreate() of the MainActivity instantiate a class named ReminderManager and then calls a public method (in this class) that set an Alert (using Alarm Manager). Another class named AlarmReceiver extends BroadcastRecevier and its onResult() method calls a new Activity.

Now I want that this activity retunrs the data inserted from user.

Schematically:

MainActivity [onCreate] ---> ReminderManager [setAlarm] ---> onResult() ---> NewActivity

NewActivity, is the activity from which I want receive data inserted from user.

I know, I can't call startActivityForResult() from onResult() of BraodcastReceiver class, so, what can be the best way for passing data to RemiderManager?

GVillani82
  • 17,196
  • 30
  • 105
  • 172
  • Possible Duplicate: http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android – Mike Mar 18 '13 at 16:56

1 Answers1

-1

Look at Android Shared Preferences: http://developer.android.com/reference/android/content/SharedPreferences.html

An example of how to use this is on another question. How to use SharedPreferences in Android to store, fetch and edit values

Community
  • 1
  • 1
BobbyD17
  • 495
  • 5
  • 16