Android Question Object context is paused...

LucaMs

Expert
Licensed User
Longtime User
Yes, I get:

Object context is paused. Ignoring CallSubDelayed: AddToActivity

CallSubDelayed (AddToActivity routine of AnotherDatePicker) is not executed, the app don't stops but when i tap on ADP:

anotherdatepicker_show (B4A line: 174)
holder.Visible = True
java.lang.RuntimeException: Object should first be initialized (Panel).


"holder" should be initialized in AddToActivity (not executed).

If you don't add the Table (mTable) in the Main Activity_Create (commenting the two relative lines), you don't get any error
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I see it now. It doesn't happen in rapid debug mode.

The cause of this issue is the DoEvents call in Table.InnerClearAll.

You can fix it by delaying the table creation:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("layMain")
   Activity.Title = "Table and DatePicker"
   CallSubDelayed(Me, "AddTable")
End Sub

Sub AddTable
   mTable.Initialize(Activity, "Table", 5, Gravity.CENTER_HORIZONTAL+Gravity.CENTER_VERTICAL, True)
   mTable.AddToActivity(Activity, 0, 0, 100%x, 40%y)
   Scale.Initialize
   Scale.ScaleAll(Activity, True)
End Sub
If the table has used a regular ScrollView then a simpler solution would have been to remove the DoEvents call by using ScrollView.ScrollToNow.
 
Upvote 0
Top