Closed Mohammed2Mujalli closed 10 months ago
Hello @Mohammed2Mujalli, have you resolved this. If no, can you explain better so I can understand?
This feature could be implemented properly, as discussed in this thread. But I'm just not sure how many people would find it useful. I'll keep this issue open for more feedback.
In the meantime, you could use this simple workaround below. Note that the TextView
itself still shouldn't be clickable, only the rest of the text are.
textView.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
s.setSpan(new ClickableSpan() {
@Override
public void onClick(@NonNull View widget) {
// do something
}
@Override
public void updateDrawState(@NonNull TextPaint ds) {
}
}, 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
});
Closed for inactivity.
I sat two click listeners. One is called setOnClickListener and the other one is called setOnHashtagClickListener because I have two actions I wanna use. For example if he click on the hashtag I want the HashtagClickListener to take me to the Hash_Tag.classand when I click on the text it takes me to the FullMessgUser.class it self. But my problem is that when I click on the hashtag it uses both the click listeners. Please can you help me solving this issue![image](https://user-images.githubusercontent.com/29471606/104931777-8f1b1e00-59af-11eb-9e82-2584288e627d.png)