Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change icon in IconTextView programmatically #198

Open
markkko opened this issue Apr 28, 2017 · 1 comment
Open

Change icon in IconTextView programmatically #198

markkko opened this issue Apr 28, 2017 · 1 comment

Comments

@markkko
Copy link

markkko commented Apr 28, 2017

Is it possible to change icon programmatically?

Neither
view.setText(getString(R.string.fa_icon_check_square), TextView.BufferType.NORMAL);
nor
view.setText(getString(R.string.fa_icon_check_square));
not works for me.
(view is a type od IconTextView)

@bennyboer
Copy link

I just searched for the same answer but didn't find any.
After some trial and error I found that although I was modifiying the IconTextView in the onCreate method of an Activity it didn't update the "{}" Icons within the TextViews text attribute.
A solution I found is explicitely calling the setText method from the UI thread with view.post(Runnable runnable).

I'm quite new to android development and don't know where the difference is (I thought calling from the onCreate of an Activity is calling the code in the UI Thread?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants