I am trying to find a set item from preference. I am tired of set.length, but it does not work. Does anyone know another way to find the length of the set?
set = prefs.getStringSet("key", null); int X = set.length; //it doesn't like length....
I believe instead of set.length, you want to call set.size()
set.size()
Your set is Set<String> , not String[] . Therefore you need to call:
Set<String>
String[]
int x = set.size();
Source: https://habr.com/ru/post/956664/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/956659/is-1024x1024-a-widely-supported-opengl-maximum-texture-size-on-the-desktop&usg=ALkJrhiQ0j9yO9mTZrBEny_odr1ZGJNXHgWhy do they pass arrays to AngularJS? - javascriptPHP - creating a dynamic multidimensional file array - arraysCreating filetree from full path in php - filePython string parsing? - pythonPowerShell Script Arguments passed as an array - powershellIs Oracle Java KeyStore implementation thread safe? - javaHow to create a table file similar to a table from an object? - htmlhandles user errors on the server side in ember-data when saving a model - ember.jsRuby namespacing with a class or module? - ruby | fooobar.comAll Articles