Y Yoldi Member Dec 13, 2019 #1 Regards. I am doing a bot with jtelegrambot and if I go out and restart the application when initializing the bot it tells me that it is running on another thread. How can I stop it? Thank you.
Regards. I am doing a bot with jtelegrambot and if I go out and restart the application when initializing the bot it tells me that it is running on another thread. How can I stop it? Thank you.
behnam_tr Active Member Licensed User Longtime User Dec 14, 2019 #2 Code: Sub mainform_Closed ExitApplication End Sub use this code on mainform Upvote 0
Philip Chatzigeorgiadis Active Member Licensed User Longtime User Dec 16, 2019 #3 behnam_tr said: Code: Sub mainform_Closed ExitApplication End Sub use this code on mainform Click to expand... The jtelegrambot is a Non-UI application, so there is no mainform. To terminate Non-UI applications, check these links: https://www.b4x.com/android/forum/threads/killing-forgotten-java-processes.82584/ https://www.b4x.com/android/forum/threads/managing-hidden-jar-processes.110804/ Alternatively, you could kill the app through Task Manager (in Windows), but if you are running multiple jar processes, it would be hard to tell which process to kill. Last edited: Dec 16, 2019 Upvote 0
behnam_tr said: Code: Sub mainform_Closed ExitApplication End Sub use this code on mainform Click to expand... The jtelegrambot is a Non-UI application, so there is no mainform. To terminate Non-UI applications, check these links: https://www.b4x.com/android/forum/threads/killing-forgotten-java-processes.82584/ https://www.b4x.com/android/forum/threads/managing-hidden-jar-processes.110804/ Alternatively, you could kill the app through Task Manager (in Windows), but if you are running multiple jar processes, it would be hard to tell which process to kill.
DonManfred Expert Licensed User Longtime User Dec 16, 2019 #4 If you are using the bot in a UI app then use Code: jtb.stop to stop the bot before you quit the UIApp... Upvote 0
If you are using the bot in a UI app then use Code: jtb.stop to stop the bot before you quit the UIApp...
DonManfred Expert Licensed User Longtime User Dec 16, 2019 #5 Philip Chatzigeorgiadis said: The jtelegrambot is a Non-UI application, so there is no mainform. Click to expand... the example for the bot IS using a UIapp to show the log in the window... Upvote 0
Philip Chatzigeorgiadis said: The jtelegrambot is a Non-UI application, so there is no mainform. Click to expand... the example for the bot IS using a UIapp to show the log in the window...
Philip Chatzigeorgiadis Active Member Licensed User Longtime User Dec 16, 2019 #6 DonManfred said: the example for the bot IS using a UIapp to show the log in the window... Click to expand... I stand corrected. I've been playing with the non-UI app included in the BotExample.zip, from your link here: https://www.b4x.com/android/forum/threads/beta-jtelegrambot-create-your-own-telegram-bot.103821/ Upvote 0
DonManfred said: the example for the bot IS using a UIapp to show the log in the window... Click to expand... I stand corrected. I've been playing with the non-UI app included in the BotExample.zip, from your link here: https://www.b4x.com/android/forum/threads/beta-jtelegrambot-create-your-own-telegram-bot.103821/
DonManfred Expert Licensed User Longtime User Dec 16, 2019 #7 Philip Chatzigeorgiadis said: I stand corrected. Click to expand... no. Sorry, my fault! IT is a nonui app... i just have the IDE open to see the LOG... So, stopping the Bot must use the usually way to kill the java process. Alternatively you can use a "Special" command to send to the bot. If the bot receives this command from a specific UID then the bot can be stopped by jtb.Stop and then calling exitapplication. Upvote 0
Philip Chatzigeorgiadis said: I stand corrected. Click to expand... no. Sorry, my fault! IT is a nonui app... i just have the IDE open to see the LOG... So, stopping the Bot must use the usually way to kill the java process. Alternatively you can use a "Special" command to send to the bot. If the bot receives this command from a specific UID then the bot can be stopped by jtb.Stop and then calling exitapplication.
Y Yoldi Member Dec 16, 2019 #8 Regards. I have an application with two buttons one to start the bot with jtb.startAsync and another button to stop the bot with jtb.stop. stopping the bot and then starting it gives the following error java.lang.IllegalStateException: You cannot start the bot while it is not idle. Is it possible to do this? Thank you Upvote 0
Regards. I have an application with two buttons one to start the bot with jtb.startAsync and another button to stop the bot with jtb.stop. stopping the bot and then starting it gives the following error java.lang.IllegalStateException: You cannot start the bot while it is not idle. Is it possible to do this? Thank you
DonManfred Expert Licensed User Longtime User Dec 16, 2019 #9 stop stopps the bot at the next timeout. The Bot isn´t supposed to be stopped, started, stopped. Create a App (NON UI). Start the bot and let it running. There is no way to stop and start it again in the library behind. Yoldi said: Is it possible to do this? Click to expand... No. Upvote 0
stop stopps the bot at the next timeout. The Bot isn´t supposed to be stopped, started, stopped. Create a App (NON UI). Start the bot and let it running. There is no way to stop and start it again in the library behind. Yoldi said: Is it possible to do this? Click to expand... No.