Android Question SMMRichEditor

Phayao

Active Member
Licensed User
Longtime User
Hello,

this lib really looks interesting - I liked to have a kind of simple texteditor in my application instead of a simple EditText field.
Now I did not unterstand something obviously: when I tried to add the smmeditor as customview in the designer, I get this error:

java.lang.RuntimeException: java.lang.ClassCastException: smm.richeditor.richeditorwrapper cannot be cast to anywheresoftware.b4a.keywords.Common$DesignerCustomView

Does it mean that the component cannot be inserted by the designer ?
To make matters worse:
When i insert it manually as in the examples, it does not offer me to add a text.

Can someone tell me where I'm going wrong here ?

Thanks in advance,

Chris
 
Hello Phayao

no, I had the same problem. The solution is:

[CODE lang="b4x" title="Use CallSubDelayed"]'Base type must be Object
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
mBase = Base
Tag = mBase.Tag
mBase.Tag = Me

' Color Dialog
Dialog.Initialize(mBase)

' let all startup activities finished
CallSubDelayed(Me, "AfterLoadLayout")
End Sub

Public Sub AfterLoadLayout()

mBase.LoadLayout("RTFEditor")
RTE.AddToParent(pnlEditor,10dip,10dip,pnlEditor.Width-20,pnlEditor.height-20)
RTE.RequestFocus[/CODE]

But you may get into the next trouble. If you use the SMMRichTextEditor inside a custom view for example to build your own Wordprocessor control than it is not able to find the Editor.html file.
 
Upvote 0
It is a mistake to post to three years old threads
 
Upvote 0
yes opened a new thread. Sorry.
 
Upvote 0
Back
Top