1

As described in the title, some Android tablets has no idea about icon. I've tested on different devices with same API Level, which I currently support back to 17, and some of them do not render this icon.

I can use TL instead of but I want to show the icon when possible. How can I check if devices support this icon?

Emre A
  • 71
  • 7

2 Answers2

2

write in strings.xml file like this

  <string name="hello">\"</string>

and in layout xml file use in textview like this

[![<TextView
        android:id="@+id/kwh1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/txtdevicename"
        android:layout_toRightOf="@+id/kwh"
        android:layout_marginTop="10dp"
        android:textSize="18sp"
        android:textStyle="bold"
        android:layout_marginLeft="10dp"
        android:text="@string/hello" />][1]][1]
Devyani Kotadiya
  • 450
  • 5
  • 19
1

You can try to use Font Awesome for Turkish Lira. Some devices might not have the Turkish Lira code, therefore you need to implement a new way. Icon : http://fontawesome.io/icon/try/ after downloading font, create a custom text view for it(for easy use)

public class FontAwesome extends TextView {


    public FontAwesome(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    public FontAwesome(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public FontAwesome(Context context) {
        super(context);
        init();
    }

    private void init() {
        Typeface tf = Typeface.createFromAsset(getContext().getAssets(),
                "/fontawesome.ttf");
        setTypeface(tf);
    }

}

Inside the xml file, create your textView like :

<your.package.FontAwesomeTextView
            android:textColor="@android:color/white"
            android:layout_width="match_parent"
            android:text="Tutariniz : 30 &#xf195;"<!--  &#xf195; equals Turkish Lira Icon code -->
            android:layout_height="wrap_content" />

You can follow the answer below :
How to use Font Awesome icon in android application?

Abdullah Tellioglu
  • 1,434
  • 1
  • 10
  • 26