-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Saved jsonStringList as a textfile in the asset folde and had problems loading.
see code:
private void NLevelExpandableListView(){
// String jsonStringList = getAssetJsonData(getApplicationContext());
String json = "";
try {
InputStream inputStream = getAssets().open("test.txt");
int size = inputStream.available();
byte[] buffer = new byte[size];
inputStream.read(buffer);
inputStream.close();
json = new String(buffer);
} catch (IOException ex){
ex.printStackTrace();
}
Log.i("Control", json);
String jsonStringList = "json";
Logcat display.....
2020-01-24 14:40:03.702 18888-18888/com.example.orcoa I/Control: [{"title": "Class 1 Accounts of Durable Resources", " +
""children":[{"title":" 10 Capital", " +
""children":[{"title":"Extended Child 111", " +
""children":[{"title":"Super Extended Child 1111"," +
""children":[]}]},{"title":"Extended Child 112"," +
""children":[]},{"title":"Extended Child 113","children":[]}]}," +
"{"title":"Child 12", " +
""children":[{"title":"Extended Child 121"," +
""children":[]},{"title":"Extended Child 122", " +
""children":[]}]},{"title":"Child 13", "children":[]}]}, " +
"{\"title\":\"Class 2\", \"children\":" +
"[{\"title\":\"Child 21\", \"children\":" +
"[{\"title\":\"Extended Child 211\", \"children\":[]}," +
"{\"title\":\"Extended Child 212\", \"children\":[]}," +
"{\"title\":\"Extended Child 213\", \"children\":[]}]}," +
"{\"title\":\"Child 22\", \"children\":" +
"[{\"title\":\"Extended Child 221\", \"children\":[]}," +
"{\"title\":\"Extended Child 222\", \"children\":[]}]}," +
"{\"title\":\"Child 23\", \"children\":[]}]}," +
"{\"title\":\"Class 3\",\"children\":[]}]
App does work as before. What could be wrong. Thanks in advance