Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/223.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在JSON响应中显示嵌入文本之间的图像_Android_Json_Retrofit2_Rx Java2 - Fatal编程技术网

Android 如何在JSON响应中显示嵌入文本之间的图像

Android 如何在JSON响应中显示嵌入文本之间的图像,android,json,retrofit2,rx-java2,Android,Json,Retrofit2,Rx Java2,我正在尝试在JSON响应中获取嵌入文本之间的图像。我正在使用Reformation2和RxJava2从服务器获取数据 以下是我的JSON回复: { "ID": "22259", "post_author": "22", "post_date": "2020-03-03 10:44:21", "post_date_gmt": "2020-03-03 05:14:21", "post_content": "<h2><span style=\"

我正在尝试在JSON响应中获取嵌入文本之间的图像。我正在使用Reformation2和RxJava2从服务器获取数据

以下是我的JSON回复:

{
    "ID": "22259",
    "post_author": "22",
    "post_date": "2020-03-03 10:44:21",
    "post_date_gmt": "2020-03-03 05:14:21",
    "post_content": "<h2><span style=\"font-size: 18pt; font-family: Georgia, Palatino;\"><strong>Egg 
Vegetarian or Non Vegetarian</strong></span></h2>\n<p><span style=\"font-size: 14pt; font-family: 
Georgia, Palatino;\">Our society comprises of vegetarians, non-vegetarians and then eggetarians. But 
it is surprising to know the word eggetarian? Because, since ages, we are not able to put the eggs 
into veg category or the non-veg category.  Few people consider that eggs are non-vegetarian since 
they come from a hen i.e. a living being. On the other hand, some people believe that they are 
vegetarian. So, let us know in depth about these eggs.</span></p>\n<p><span style=\"font-size: 14pt; 
font-family: Georgia, Palatino;\">Finally, now scientists have given us the answer for this 
controversy. After studying in depth about this and doing their research, scientists have put end to 
this debate &amp; said that eggs are '<strong><a href=\"https://www.flypped.com/best-diet-to- 
increase-long-life-expectancy/food/\">VEGETARIAN</a></strong>'.</span></p>\n<p><span style=\"font- 
size: 14pt; font-family: Georgia, Palatino;\">This is excellent news for vegetarians as now; they can 
add one more thing to their diet.</span></p>\n<p><span style=\"font-size: 18pt; font-family: Georgia, 
Palatino;\"><strong>Vegetarian Eggs 1 Composition of Egg</strong></span></p>\n<p><img 
class=\"aligncenter size-full wp-image-22261\" src=\"https://www.flypped.com/wp- 
content/uploads/2020/03/Composition-of-Egg.jpg\" alt=\"Composition of Egg\" width=\"800\" 
height=\"300\" /></p>\n<p><span style=\"font-size: 14pt; font-family: Georgia, Palatino;\">Scientists 
explained that the egg consist of 3 parts i.e. egg shell, egg white and egg yolk. The yolk consists 
of fat, cholesterol and proteins while whites have only protein.</span></p>\n<p><span style=\"font- 
size: 14pt; font-family: Georgia, Palatino;\">Scientists also said that the eggs that which are 
consumed by us daily aren't fully developed and don't have embryos. For this one is not eating 
bird/animal as these eggs don't have embryos and are unfertilized.</span></p>\n<p><span style=\"font- 
size: 18pt; font-family: Georgia, Palatino;\"><strong>Vegetarian Eggs 2 Unfertilized eggs</strong> 
</span></p>\n<p><img class=\"aligncenter size-full wp-image-22262\" src=\"https://www.flypped.com/wp- 
,
    "post_title": "Are Eggs Vegetarian Or Non-Vegetarian? You Will Be Surprised To Know These Facts",
    "post_excerpt": "",
    "post_status": "publish",
    "comment_status": "open",
    "ping_status": "closed" 
}
{
“ID”:“22259”,
“post_作者”:“22”,
“发布日期”:“2020-03-03 10:44:21”,
“发布日期”:“2020-03-03 05:14:21”,
“post_内容”:“鸡蛋
素食者或非素食者\n我们的社会由素食者、非素食者和后来的蛋族组成。但是
知道“鸡蛋人”这个词是令人惊讶的,因为自古以来,我们就不能把鸡蛋放进去
很少有人认为鸡蛋是非素食的。
它们来自母鸡,也就是活的生物。另一方面,有些人认为它们是
素食者。所以,让我们深入了解这些鸡蛋。

\n最后,现在科学家已经给了我们答案 在对此进行深入研究并进行研究后,科学家们结束了这一争论 这场辩论说鸡蛋是“”。

\n这对素食者来说是个好消息,就像现在一样;他们可以 在他们的饮食中再加一件东西。

\n素食鸡蛋1鸡蛋的成分

\n\n科学家们还说,那些 我们每天吃的东西都没有发育完全,也没有胚胎。因为这一个是不吃的 鸟类/动物,因为这些蛋没有胚胎且未受精。

\n素食蛋2个未受精蛋

\n 有人请告诉我如何从
post\u content
输入JSON响应中获取图像和文本。 任何帮助都将不胜感激


谢谢

尝试使用Gson进行json解析。选中此处,您将获得post_内容(String)-这是对象MyResponse的一个字段(选中annotation@SerializedName)。在String post_内容中,您可以获得String.startWith(“src”),例如,但Amit提供了更正确的方法