I'm trying to use font-awesome icons and having some problem. It worked from MainActivity but when I use from Fragment its not showing up the icons.
This is my HomeFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View home = inflater.inflate(R.layout.fragment_home, container, false);
View feed_row = inflater.inflate(R.layout.feed_row, container, false);
like_button = (Button) feed_row.findViewById(R.id.like_button);
Typeface tf = Typeface.createFromAsset(getActivity().getAssets(), "fonts/fontawesome-webfont.ttf");
like_button.setTypeface(tf);
mHomeFeed = (RecyclerView) home.findViewById(R.id.home_feed);
mLayoutManager = new LinearLayoutManager(this.getActivity());
mHomeFeed.setHasFixedSize(true);
mHomeFeed.setLayoutManager(mLayoutManager);
This is feed_row.xml:
<Button
android:id="@+id/like_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/icon_heart"
android:background="@color/noBackground"/>
Strings.xml
<string name="icon_heart"></string>
<string name="icon_comment"></string>
What should I do now? It had no error but icons looked like below: