Android crash in Hide after I added a toolbar

General TRichView support forum. Please post your questions here
Post Reply
whisper1980
Posts: 31
Joined: Sun May 25, 2025 6:41 pm

Android crash in Hide after I added a toolbar

Post by whisper1980 »

I added a toolbar based entirely on your Editor2 demo. It works great on iOS, but crashes Android when I do a rve.Clear (even though your demo does not crash).

In fmxRVSelectionHandlesFM, procedure TRVFMXSelectionHandles.Hide, line 594 you have this:

Code: Select all

  if CaretPt <> nil then
    CaretPt.Visible := False;
The first time I go to load the TRichViewEdit, I invoke Clear, and the value of CaretPt is: $b400007b0f1108d0 (your demo has a value that is also not nil ($b400007b0f0d2970).

If I set it to nil using the debugger this one time, it continues just fine and does not crash, and I can continue to clear and load new content into the TRichViewEdit without fail. I must not be doing something after adding the toolbar, but I can't find what that might be.

Some other things: I also don't get that little balloon popup to move the caret precisely as in your demo. On iOS only, my app doesn't crash at all, but I can't place the caret in a word... it puts the caret at the start or end of the word I tap on.

Got any ideas?
Eric
whisper1980
Posts: 31
Joined: Sun May 25, 2025 6:41 pm

Re: Android crash in Hide after I added a toolbar

Post by whisper1980 »

This is the stack trace when it crashes on CaretPt.Visible := False; where in this case, CaretPt is $b400007b0f110f40

Code: Select all

Fmxrvselectionhandlesfm.TRVFMXSelectionHandles.Hide()($b400007b9f257cf0)
Fmxrvselectionhandlesfm.TRVFMXSelectionHandles.SetPositions(bool)($b400007b9f257cf0,false)
Fmxrvrvdata.TRichViewRVData.UpdateSelectionHandles(bool, bool)($b400007c4f0983b0,false,false)
Fmxrvrvdata.TRichViewRVData.DoSelect()($b400007c4f0983b0)
Fmxrvervdata.TRVEditRVData.DoSelect()($b400007c4f0983b0)
Fmxcrvfdata.TCustomRVFormattedData.Deselect(Fmxrvitem.TCustomRVItemInfo*, bool)($b400007c4f0983b0,nil,true)
Fmxrvctrldata.TRVControlData.Deselect(Fmxrvitem.TCustomRVItemInfo*, bool)($b400007c4f0983b0,nil,true)
Fmxcrvfdata.TCustomRVFormattedData.Clear()($b400007c4f0983b0)
Fmxrvrvdata.TRichViewRVData.Clear()($b400007c4f0983b0)
Fmxrvervdata.TRVEditRVData.Clear()($b400007c4f0983b0)
Fmxrichview.TCustomRichView.Clear()($b400007acf0b6440)
Post Reply