How do I know when user edited the text on TextAnnoation so the app can save it?
How to do the same for https://www.scichart.com/questions/wpf/get-textannotation-text-after-user-editing for Android and iOS version of SciChart?
- Zhiheng Cao asked 4 years ago
- You must login to post comments
Hi there,
For Android we don’t provide direct listener for text of TextAnnotation, but you can set it for TextView which is used by annotation for displaying text:
final TextAnnotation textAnnotation = sciChartBuilder.newTextAnnotation().withCanEditText(true).withIsEditable(true).build();
final EditText textView = (EditText) textAnnotation.findViewById(R.id.text);
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) {
Log.d("TextAnnotation", s.toString());
}
@Override
public void afterTextChanged(Editable s) {
}
});
textAnnotation.setText("Your text here");
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 4 years ago
- You must login to post comments
Please login first to submit.