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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:13:26+00:00 2026-06-13T12:13:26+00:00

This is (a part of) my arrayValues: <string-array name=securityValues> <item name=wep>capabilities LIKE ‘%WEP%'</item> <item

  • 0

This is (a part of) my arrayValues:

<string-array name="securityValues">
<item name="wep">"capabilities LIKE '%WEP%'"</item>
<item name="wpa">"capabilities LIKE '%WPA%'"</item>
<item name="free">"capabilities NOT LIKE '%WPA%' AND capabilities NOT LIKE '%WEP%' AND capabilities NOT LIKE '%WPS%'"</item>
<item name="all">"1"</item>

and this is a part of my preferences.xml

 <ListPreference 
    android:key="visualizzazione_marker_security"
    android:title="Sicurezza Wifi da visualizzare"
    android:summary="Scegli con quale protocollo di sicurezza vuoi che siano visualizzate le wifi"
    android:entries="@array/security"
    android:entryValues="@array/securityValues"

/> 

and finally my code:

    @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(Menu.NONE, 0, 0, "Only free wifi");
    menu.add(Menu.NONE, 1, 1, "All wifi");
    return super.onCreateOptionsMenu(menu);
  }

switch (item.getItemId()) {
    case 0:

        Editor edit = PreferenceManager.getDefaultSharedPreferences(this).edit();
        edit.putString("visualizzazione_marker_security","capabilities NOT LIKE \'%WPA%\' AND capabilities NOT LIKE \'%WEP%\' AND capabilities NOT LIKE \'%WPS%\'").apply();
        edit.commit();
        Toast.makeText(this, "Wait 30 seconds please", Toast.LENGTH_LONG).show();
        case 1:
            Editor edit1 = PreferenceManager.getDefaultSharedPreferences(this).edit();
        edit1.putString("visualizzazione_marker_security","1").apply();
        edit1.commit();
        Toast.makeText(this, "Wait 30 seconds please", Toast.LENGTH_LONG).show();
        return true;
}

why case0 not apply the modify? The value in preferences always change to 1!

  • 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-13T12:13:27+00:00Added an answer on June 13, 2026 at 12:13 pm

    You are missing a break; statement in your case block. So case 0 gets overwritten by case 1.

    switch (item.getItemId()) {
        case 0:
            Editor edit = PreferenceManager.getDefaultSharedPreferences(this).edit();
            edit.putString("visualizzazione_marker_security","capabilities NOT LIKE \'%WPA%\' AND capabilities NOT LIKE \'%WEP%\' AND capabilities NOT LIKE \'%WPS%\'").apply();
            edit.commit();
            Toast.makeText(this, "Wait 30 seconds please", Toast.LENGTH_LONG).show();
            break;
    
        case 1:
            Editor edit1 = PreferenceManager.getDefaultSharedPreferences(this).edit();
            edit1.putString("visualizzazione_marker_security","1").apply();
            edit1.commit();
            Toast.makeText(this, "Wait 30 seconds please", Toast.LENGTH_LONG).show();
            return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So This part of my code: print_r($_SESSION['T']); $T = array_values($data2); print_r($_SESSION['T']); Outputs this: Array
I have a bunch of name/email fields in my form like this: data[Friend][0][name] data[Friend][1][name]
I have this part of code string query = SELECT ID, COL1 FROM TABLE1
This part of the code is fine i do not see any problem there
Consider this part of code: Try arqTXT.LoadFromFile(LogPath); finally ShowMessage( The log file could not
Okay, I have an array in my Main Class that looks like this: objectArray:Array
This part ( -name *txt -o -name *html ) confuses me in the code:
See this part of my xml: <blocktype> <properties name=normal_blue type=1/> <resources image=brick_blue/> <properties powerup=0
I hope i did not skip this part in the ObjC manual but is
I have a string in the format: t='@abc @def Hello this part is text'

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.