Reputation: 11
How I can change some icons which are declared in strings.xml
<resources>
...
<string name="icon_info"></string>
<string name="icon_heart"></string>
....
and after I use them in some source files in java
Button txt=(Button) findViewById(R.id.infotxt);
Button txt1=(Button) findViewById(R.id.hearttxt);
Typeface webfont = Typeface.createFromAsset(getAssets(), "fontawesome-webfont.ttf");
txt.setText(" " + getString(R.string.icon_info) + " ...");
txt.setTypeface(webfont);
txt1.setText(" " + getString(R.string.icon_heart) + " ...");
txt1.setTypeface(webfont);
I would like to change these icons to other icons I have on my computer.
Upvotes: 1
Views: 3063
Reputation: 150
<string name="icon_info"></string>
<string name="icon_heart"></string>
they are fonts, not real images icon!!!! you can do : 1. convert your icons to font and use it as same as above, look at this article also this is usefull. 2. put your image file in drawable or assets and use it as a normal image file
Upvotes: 1