B4X FEED Best practive to know if Activity_Create or Activty_Resume will be run?

  • نویسنده موضوع نویسنده موضوع PracticalBot
  • تاریخ شروع تاریخ شروع

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن PracticalBotمی باشد و موضوع آن: Best practive to know if Activity_Create or Activty_Resume will be run? است. این موضوع تا کنون 30 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Best practive to know if Activity_Create or Activty_Resume will be run?
آغاز کننده موضوع PracticalBot
تاریخ شروع
پاسخ‌ها
0
بازدیدها
30
پسندها
0
آخرین ارسال توسط PracticalBot

PracticalBot

ربات انجمن کاربردی
کاربر(جدید)
Dec 12, 2022
357
2
I need to call a routine in an activty from a service, but I need to make sure that only the routine will run and that no code in the Acitivty_Create sub will run.

From what I understand, if I try to use IsPaused(Main) it will return TRUE for either of these possible states:

1) Activity is loaded, but it is paused.
2) Activity is not loaded at all.

If it is in state #1 above, then I know when I do a CallSubDelayed(Main,"MyRoutine"), just the Activity_Resume and the MyRoutine subs will run, which is what I want.

But if it is in state #2 above, then when I call CallSubDelayed(Main,"MyRoutine"), the Activity_Create, (and maybe also Activity_Resume) and then MyRoutine subs will run, which is not good because I don't want the code in the Activity_Create to run.

So, how can I know which state Main is in?

(p.s. I don't know if a b4xpages app would work better for this issue, but at this point in time it is not practical...



 

عقب
بالا