Building an Android application using Google’s GCM service.
I have implemented the onRegistered method in the GCMIntentService class.
The problem is I want to send the email from EditText in my main activity to my server along with the regId. I’m not sure how to get the email from my main activity and use it in the onRegistered method.
I know how to properly get the string from the EditText box within the main activity that’s not a problem. It’s throwing me off because it’s in a separate class.
My end result is I want to send the email they have typed into the EditText and when they click register the email the email they’ve typed and their regId will be stored in database on my server.
I currently have working code that just stores their regId with a hard coded name in the onRegistered method. Just looking how to get that additional information so I can send it with the regId.
When the user presses the button, you can put the text from the
EditTextin a:SharedPreferencesand then retrieve the text from that location in
onRegistered().