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