score:-1
have a try the below codes:
for(string s: selections){
if("movies-checked".equals(s)) {
}
if("test-checked".equals(s)) {
}
if("test23-checked".equals(s)) {
}
}
score:2
it stores only the ones that are checked.
you can put values as indices.
<string-array name="catos">
<item >movies</item>
<item >test</item>
<item >test23</item>
</string-array>
<string-array name="catovalues">
<item >0</item>
<item >1</item>
<item >2</item>
</string-array>
0 - movies => checked
1 - test => unchecked
2 - test23 => checked
in the preferences file will only indexes 0 and 2, and you can assume that others are unmarked.
so if you analyze the set <string>
, its size will be only 2 strings
with 0 and 2.
Source: stackoverflow.com
Related Query
- Multiselectlistpreference android retrieving values
- android application development- saving and retrieving the values of editText and textView
- Retrieving the null value from Sqlite database in android
- retrieving default values defined in Java net.properties file
- Eclipse android preferencesfile; cant read the values of the keys
- Using different values for constants in development and live Android builds
- Issue with Retrieving JSON from Webpage Android
- Error in AndroidManifest.xml File of an Android Project With Default Values
- Android Countdown Timer crash and wrong values
- Displaying the averaged values of the speedometer android
- Cant able to run Android app and error: Error retrieving parent for item error
- java - Adding of cursor values into an ArrayList in Android Eclipse
- Android openGL es 2.0 RGB Values not correct when using GL_fragcolor
- Android Localization structure of values folder
- Xml values from URL in android
- Create Android project from source in Eclipse: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'
- Android Eclipse Debugging: Getting Intermediate Values
- Eclipse error create android app:Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'
- Android sensor values to be used in another function
- String null values in Eclipse Android
- Manipulate values of two Numberpickers Android
- Retrieving bitmap image from a URL ,getting nullpointerexception randomly in android
- How to fetch values from GAE datastore to android application ?
- Get longitude and latitude values to post into url - Android
- Android Eclipse Edit String of values directory in Java
- Displaying CSV values in ANDROID APPLICATIONS ( After opening the APK )
- How to change Default Values of Android XML using Eclipse
- Retrieving a particular data from webservice on android eclipse
- Android - Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitleBackground'
- "Debug certificate expired" error in Eclipse Android plugins
More Query from same tag
- Jave Swing Eclipse - JPanel and components auto resize
- IBM Worklight wizard is not appearing in eclipse
- Android Studio fails to import my Eclipse Projects, either directly or as Gradle project
- maven could not resolve project dependencies?
- Eclipse workspace and Git folder layout
- android:screenOrientation=“sensorPortrait" not valid?
- BreakPoints not being hit?
- Animated GIF in SWT table/tree viewer cell
- Can't pass values from one intent to another
- Incompatible operand types String and char syntax error
- retrieving default values defined in Java net.properties file
- Serial Port Communication Using Java & RXTX in Eclipse
- Is there a way to generate custom BuildConfig.java file when deploying from eclipse?
- Eclpise and pyDev
- How Can I Communicate with another application?
- Able to run Android application from Eclipse, but not directly from phone
- error while downloading web-app_4_0.xsd in dynamic web app eclipse
- Servlet example - File not found
- initialization after switch-statement
- How to get PHPUnit to recognize Libraries
- ADB stucks on my Android smart phone
- how to hide revision number from eclipse explorer view?
- Error when trying to compare instance of a class with a variable type
- what event perform in termination action
- Cannot create a new Maven project in eclipse
- Automatic import windowbuilder in my own eclipse plugin
- Unable to select my Android device when running project in Eclipse
- Eclipse - Unexpected error loading extension: org.eclipse.equinox.p2.metadata.repository.compositeRepository
- Always execute copy-dependencies after updating dependencies in eclipse
- Fixing code: Finding all calls to the ordinal method of an enum