We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
The text was updated successfully, but these errors were encountered:
Hello error : String jsonStringList = "json";
good code : String jsonStringList = json;
String jsonStringList = json;
or please check with this method :
public String initJSONFile() { String json = null; try { InputStream is = getAssets().open("Your.json.txt"); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); json = new String(buffer, "UTF-8"); } catch (IOException ex) { ex.printStackTrace(); return null; } return json; }
Sorry, something went wrong.
No branches or pull requests
Saved jsonStringList as a textfile in the asset folde and had problems loading.
see code:
private void NLevelExpandableListView(){
// String jsonStringList = getAssetJsonData(getApplicationContext());
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":[]}]}, " +
App does work as before. What could be wrong. Thanks in advance
The text was updated successfully, but these errors were encountered: