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

  • Home
  • SEARCH
  • 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 7686743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:32:56+00:00 2026-05-31T19:32:56+00:00

I am creating one application for student. I need to set the different message

  • 0

I am creating one application for student. I need to set the different message whenever
user open application.I don’t understand how to do this or which method use for this.
I search lot of articles but i didn’t found anything.
So please provide me some reference or code.

  • 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-05-31T19:32:57+00:00Added an answer on May 31, 2026 at 7:32 pm

    Save your messages in a persistent storage. In android, you could use SharedPreference http://developer.android.com/reference/android/content/SharedPreferences.html, or a Sqlite databse http://developer.android.com/reference/android/database/sqlite/package-summary.html depending on your specific need. Store the messages in either of them and read back a different message each time.
    Store some msgs in a SharedPreference at some point in your Activity:

    SharedPreferences pref =    getPreferences(Context.MODE_PRIVATE);
            Editor ed =pref.edit();
            ed.putString("0","msg0");
            ed.putString("1","msg1");
            ed.putString("2","msg2");
            ed.putString("3","msg3");
            ed.commit();
    

    Then in onCreate(), retrieve a random sg and diplay to the user:

    @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            SharedPreferences pref =    getPreferences(Context.MODE_PRIVATE);
            Random r = new Random();
    
            String msg = pref.getString(r.nextInt(4)+"", "none");
            Toast.makeText(this, msg, Toast.LENGTH_LONG ).show();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an iPad application which needs a UIPopoverController like this one (I mean,
I am creating one desktop application in which I want to track user activity
I am Creating one application in which I want to set one swf as
I am creating an application for the iPhone which involves having more than one
I am creating one application in .net MVC, in which I am using jQuery
I am creating one sample application in which i am reading database and displaying
I am creating one application which convert text into speech in Indian English. I
I am creating one application in which I am using resource files to keep
I am creating one web application in which I am showing watermark text for
I am creating one application with jquery.mobile-1.0a4.1 release. I have a page which is

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.