首页 > 解决方案 > 如何在android的两个不同活动中显示嵌套的json对象和数组

问题描述

我有一个包含嵌套对象和数组的 Web 服务,我已经在一个活动中解析了数据,但是我想在两个不同的活动中显示数据,我该如何实现呢?

标签: androidarraysjsonobjectnested

解决方案


This SO post (Storing/retrieving strings with shared preferences) explains how to add and retrieve strings from sharedPrefs. After downloading the JSON in your web service, store the response in ActivityA, and when opening ActivityB, retrieve and parse the JSON using a method common to both activities.


推荐阅读