I want to take the values one by one from my String to print it
StringBuilder t = new StringBuilder();
for(int l=0; l<=itemList.length(); l++){
Log.d("SPA", "PRINT LOOP " +t);
Log.d("SPA", "PRINT LOOPP " +l);
}
This is what i have tried and it is not working.
I am using Shared Preference to take multiple values from previous class from JSON
To retrieve the values from SHARED PREFERNECE
SharedPreferences mySharedPreferences = this.getSharedPreferences("MYPREFERENCENAME1", Context.MODE_PRIVATE);
ServicesFromDeatailsPage=(mySharedPreferences.getString("yourKey", null));
To Make it into String :
String itemList = Stream.of(ServicesFromDeatailsPage )
.filter(Objects::nonNull)
.collect(Collectors.joining("\n"));
output is:
list is {"0":"Hair","1":"Makeup","2":"Nail"}
Now what i want is to take values one by one from each index and save it in database with just one button click.
Can i do it with for loop and if yes, how? or is there any other way to do this in android studioThis is what i want . This is what iam geting