improved json conversion
This commit is contained in:
parent
98a4bed7b0
commit
7fadd4771f
@ -1,7 +1,5 @@
|
||||
package com.example.aped.communication;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -247,10 +247,14 @@ public class ConfigurationHandler implements IFAVORITES {
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
List<String> favoriteNamesString = new ArrayList<>();
|
||||
for (String favoriteName : favoriteNames){
|
||||
favoriteNamesString.add("\"" + favoriteName + "\"");
|
||||
}
|
||||
return "{\n"
|
||||
+ "\"address\":\"" + address + "\",\n"
|
||||
+ "\"port\":\"" + port + "\",\n"
|
||||
+ "\"favorites\":" + favoriteNames.toString() + "\n"
|
||||
+ "\t\"address\":\"" + address + "\",\n"
|
||||
+ "\t\"port\":\"" + port + "\",\n"
|
||||
+ "\t\"favorites\":" + favoriteNamesString.toString() + "\n"
|
||||
+ "}";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user