I can only get part of a url (link) and put into string in android?

后端 未结 2 1497
走了就别回头了
走了就别回头了 2020-12-22 13:48

[Solved] - I need to resolve the problem below Ok I wasn\'t really sure how to word this question, but basically what I want to do is, I g

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-22 14:27

    Do it like this

    String url = "http://www.prsn.uprm.edu/Spanish/Informe_Sismo/myinfoGeneral.php?id=20161206012821";
    String[] array = url.split("id=");
    String id  = array[1];
    String urlToLoad = "http://shake.uprm.edu/~shake/archive/shake/"+id+"/download/tvmap.jpg"
    Glide.with(context).load(urlToLoad).into(holder.Thumbnail);
    

    Then use this id where you want to use

提交回复
热议问题