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 8469119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:08:05+00:00 2026-06-10T16:08:05+00:00

I made a spinner in android public SiriusRadioPlayerActivity(){ String[] arrayOfString = new String[4]; arrayOfString[0]

  • 0

I made a spinner in android

        public SiriusRadioPlayerActivity(){
    String[] arrayOfString = new String[4];
    arrayOfString[0] = "Kiskunfélegyháza HQ [160kbps MP3]";
    arrayOfString[1] = "Kiskunfélegyháza MQ [64kbps AAC]";
    arrayOfString[2] = "Kiskunmajsa HQ [160kbps MP3]";
    arrayOfString[3] = "Kiskunmajsa MQ [64kbps AAC]";
    this.items = arrayOfString;

     }        

These are my strings to display!

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    initializeUIElements();

this.savszelesseg_port = localSharedPreferences.getString("savszelesseg_mentes",      "savszelesseg_port");
    this.savszelesseg_saved = this.savszelesseg_port;

Here I load data from my prefs!

  final Spinner localSpinner = (Spinner)findViewById(R.id.savszelesseg);
    ArrayAdapter localArrayAdapter = new ArrayAdapter(this,android.R.layout.simple_spinner_dropdown_item, this.items);
    localArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    localSpinner.setAdapter(localArrayAdapter);

Created the spinner. And have en setOnItemSelectedListener function.

    localSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() 
    {
        public void onItemSelected(AdapterView parentView, View childView, int position, long id) 
        {
            if (!savszelesseg_port_modositva)
            {
              savszelesseg_beallitas = "Kiskunfélegyháza HQ [160kbps MP3]";
              savszelesseg_port_modositva = true;
            }
 if (savszelesseg_beallitas == "Kiskunfélegyháza HQ [160kbps MP3]")
            {
              savszelesseg_port = "8500/relay_911";

            }


        }
        public void onNothingSelected(AdapterView parentView) 
        {
        }
    });

The question is: How to store savszelesseg_port to to my SharedPreferencies savszelesseg_mentes default value? Because I have a Timer to check periodically a webpage, and it depends on which value I get from the sharedpreferencies:

this.mWebView = ((WebView)findViewById(0x7f070035));
    this.mWebView.getSettings().setJavaScriptEnabled(true);
    new Timer().scheduleAtFixedRate(new TimerTask()
    {
      public void run()
      {
        if (SiriusRadioPlayerActivity.isOnline()){

            if (SiriusRadioPlayerActivity.this.mWebView_enabled == false){
                SiriusRadioPlayerActivity.this.mWebView.loadUrl("about:blank"); 
            }
            else
            {

                if(savszelesseg_port.contains("911")){
                 SiriusRadioPlayerActivity.this.mWebView.loadUrl("http://xxxx");    
                }
                if(savszelesseg_port.contains("882")){
                 SiriusRadioPlayerActivity.this.mWebView.loadUrl("http://xxx"); 
                }

                }

        }



      }}
    , this.delay, this.period);
    this.mWebView.setBackgroundColor(0);

Localsharedpreferencies:

PreferenceManager.setDefaultValues(this, 0x7f040000, false);
    final SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    this.mWebView_enabled = localSharedPreferences.getBoolean("mWebView_enabled", true);
    this.savszelesseg_port = localSharedPreferences.getString("savszelesseg_mentes", "savszelesseg_port");
  • 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-10T16:08:07+00:00Added an answer on June 10, 2026 at 4:08 pm

    After the line:

              savszelesseg_port = "8500/relay_911";
    

    You should do :

    SharedPreferences.Editor editor = localSharedPreferences.edit();
    editor.putString("savszelesseg_mentes", savszelesseg_port);
    editor.commit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a Spinner in Android: category = (Spinner) findViewById(R.id.ev_category); category.setOnItemSelectedListener(new MyOnItemSelectedListener()); ArrayAdapter<CharSequence>
I am new to android world. I have made an application of a user
I made an article spinner that used regex to find words in this syntax:
I made this server class that starts a thread when new connection comes in.
Made this nice little loop for hiding and showing div's, works as a charm
Made a custom obj called Item with some string fields and one float. .h
I want to use a Spinner that initially (when the user has not made
Made this custom alert box: <script type="text/javascript"> $(function () { var $alert = $('#alert');
I'm using spinner controls in an Android application, and I handle user selections via
I made a spinner with OnItemSelectedListener function. I made it from an array, which

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.