Convert String to Drawable

后端 未结 8 2248
我在风中等你
我在风中等你 2021-02-20 12:31

I want to raise a notification showing an icon in the status bar - so far so good, but actually I would like this icon to be a 3 character String.

So my question is: Is

8条回答
  •  眼角桃花
    2021-02-20 13:36

       public Drawable getDrawable(String bitmapUrl) {
          try {
            URL url = new URL(bitmapUrl);
            Drawable d =new BitmapDrawable(BitmapFactory.decodeStream(url.openConnection().getInputStream()));
            return d; 
          }
          catch(Exception ex) {return null;}
        }
    

提交回复
热议问题