如何从 themoviedb api 的响应中获取图像

Abh*_*yay 2 java android themoviedb-api

我从 themoviedb API 收到以下 JSON 响应:

\n
{\n         "popularity":1640.159,\n         "vote_count":32,\n         "video":false,\n         "poster_path":"\\/9Rj8l6gElLpRL7Kj17iZhrT5Zuw.jpg",\n         "id":734309,\n         "adult":false,\n         "backdrop_path":"\\/7fvdg211A2L0mHddvzyArRuRalp.jpg",\n         "original_language":"en",\n         "original_title":"Santana",\n         "genre_ids":[\n            28\n         ],\n         "title":"Santana",\n         "vote_average":6.3,\n         "overview":"Two brothers \xe2\x80\x94 one a narcotics agent and the other a general \xe2\x80\x94 finally discover the identity of the drug lord who murdered their parents decades ago. They may kill each other before capturing the bad guys.",\n         "release_date":"2020-08-28"\n      }\n
Run Code Online (Sandbox Code Playgroud)\n

我必须使用poster_path但我无法理解它,因为它只是图像名称而不是任何路径。我不知道如何从这个poster_path字符串中获取图像。

\n

请帮我!当我将网址粘贴到 Google 上时,我什么也没得到。

\n

Ast*_*tha 18

根据电影数据库文档,它的格式如下:-

http://image.tmdb.org/t/p/w500/your_poster_path
Run Code Online (Sandbox Code Playgroud)

(从您的问题中获取海报路径,现在您可以通过将其作为 URL 粘贴到浏览器中来查看图像 - http://image.tmdb.org/t/p/w500/9Rj8l6gElLpRL7Kj17iZhrT5Zuw.jpg

使用 Glide 或 picasso 通过遵循其他答案来显示它。