Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9113771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:02:32+00:00 2026-06-17T04:02:32+00:00

I have a GCM class, which gets a message that has 2 separate strings

  • 0

I have a GCM class, which gets a message that has 2 separate strings from Google GCM server. I need to use those 2 strings inside another activity of my application. The problem is that i do not know in advance how many these gcm messages are gonna be. I need to store these values and use them in another Activity to present them to the user inside a layout. I’ m finding this difficult cause first of all, i don’t know how many these messages are gonna be, so i can’t draw the layout in advance, and secondly cause i haven’t found an effective of storing these 2 strings together, so that i am able later to manipulate them.

Each group of these two strings, belong to a user and should be stored in a way so that they can be retrieved separately from other group of strings.

I have tried to do this by using SharePrefrences or intents but i can’t find a proper solution to this.

I know my question might seem silly, and i am not asking for a solution, but i am stuck and i would be really glad, if someone could give me some advice or guidance on some workaround to this, or where to look..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T04:02:34+00:00Added an answer on June 17, 2026 at 4:02 am

    You should be able to store them in an ArrayList or HashMap and send them through an Intent. You won’t need to know how many there are, just use a loop to add however many exist into the list. When showing them, you can use a ListView to show them so you don’t have to worry about knowing how many there are each time but you can get the count so you can know if needed. Other than that, its hard to say without seeing what you have tried, what is/isn’t working/ or what you already know so I have added a few links which may be helpful in understanding these objects

    ArrayList

    HashMap

    consider LinkedHashMap if you are concerned with the order of the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

cannot use the GCMRegisterar from gcm.jar which i have added to build path ,but
I have a GCM class which includes a send_notification function. In a different class,
I have Datastore Class and I use this class to try GCM . I
I am trying to send a message through GCM (Google Cloud Messaging). I have
I have created an application in Google console, and get the GCM server API
Have a bunch of classes which I need to do serialize and deserialize from/to
I have followed http://developer.android.com/guide/google/gcm/gs.html#server-app to implement GCM in my application GCMRegistrar.checkDevice(this); GCMRegistrar.checkManifest(this); if (GCMRegistrar.isRegistered(this))
have written this little class, which generates a UUID every time an object of
Building an Android application using Google's GCM service. I have implemented the onRegistered method
I have migrated my app to use the new GCM push system. It works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.