Home > Mobile >  Help Android bosses, how to obtain gson data
Help Android bosses, how to obtain gson data

Time:09-19

Lists is the definition of type String, do

CodePudding user response:

For help and do is get a zhihu data

CodePudding user response:

Compile error is not already telling,
List the type is List While getStories return List Type, type mismatch,

CodePudding user response:

2 floor bow quoted water response:
compile error wasn't the problem,
List the type is List While getStories return List Type, type mismatch,

Is this
I use this app # CSDN# found have technical content of the blog and friends to seek common to "Android Material basic Design style is used (implement simple news app)", gathered together at https://blog.csdn.net/XCF95319605/article/details/81121207? Utm_source=app

I do is according to this post, is Posting big wrong, who can you help me to see the reason

CodePudding user response:

Injection of javabeans should as follows, and then injected into the StoryBeans class,
 
The class StoryBean {
.
}
The class StoryBeans {
Public StoryBean storyBeans [];

Public xx getStoryBeans () {
Return this. StoryBeans;
}
}

CodePudding user response:

refer to 4th floor, the spring would not be old reply:
injection javabeans should as follows, and then injected into the StoryBeans class,
 
The class StoryBean {
.
}
The class StoryBeans {
Public StoryBean storyBeans [];

Public xx getStoryBeans () {
Return this. StoryBeans;
}
}

What the xx mean

CodePudding user response:

Type is not corresponding to this is that the background with the plugin gsonformat studio at a key to switch back to data copy and paste is then generated class, using Gson parsing

Private List Biji_datalist_temp=new ArrayList<> (a);

Entity_BiJi Entity_BiJi=new Gson (). FromJson (" back-end data ", new TypeToken}. GetType ());

Biji_datalist_temp=entity_biJi. GetData (). GetLists ();

CodePudding user response:

Very convenient gsonformat baidu how to hold

CodePudding user response:

His data is

{images: [1, 2]},
{... }
]

You need getStoreBean. Get (I). GetImages, which I saw your demand
  • Related