0

sorry if this is a dumb question, I don't have java/android dev experience I'm more of a c/c++ or python person. Right now I have a edittext with input type multiline to allow a user to write long messages. I want to capture android's software keyboard carriage return and automatically add a bullet for formatting.

Google Keep seems to do this well. I can type as much as I want in a note and if press enter a new line with a bullet is added. I tried adding android:imeOptions in my xml file and adding onEditorAction in the code, but the action is not firing. If I change android:inputType="textMultiLine" to android:inputType="text" I can capture the enter key, but the text only goes on one line now.

  • this seems like something you'd use [Spannables](https://developer.android.com/reference/android/text/Spannable.html) for. Check out some resources on how to replace regex/patterns in TextView with whatever you want; a few [here](https://takeoffandroid.com/android-spannable-text-view-to-change-color-size-style-and-adding-click-event-for-particular-word-8acd8a05ec61) and [here](https://stackoverflow.com/questions/14840247/spannable-on-android-for-textview) – Joey Dalu Feb 11 '18 at 19:01
  • Perfect, thank you! I'll research spannables – codingWaffles Feb 11 '18 at 20:33

0 Answers0