Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert String to Drawable

Tags:

android

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 there a way to convert my String into a Drawable to display it as Icon in the status bar?

EDIT: I recently found an app which does something similar - Battery Indicator

It shows the current battery level as notification icon in the status bar - I wonder if it really uses different 100 images

Screenshot

like image 337
DonGru Avatar asked Aug 27 '10 14:08

DonGru


1 Answers

Short: No, you can't.

Long: The notification needs a R.drawable.something for the icon and you can't create it on runtime.

like image 196
Macarse Avatar answered Sep 18 '22 01:09

Macarse