WindowManager type toast obtain

I use pthon development language,appium version is 1.20.2,page_source didn’t print out any toast,appium.webdriver.common.mobileby.XPATH did not obtain too. code as follows:
loc = ‘//*[contains(@text,"{}")]’.format(“Cannot be empty”)
try:
el = WebDriverWait(driver, 10,
0.01).until(EC.presence_of_elements_located((By.XPATH, loc)))
print(el.text)
except:
print(" No toast!!!!")
What should I do?
Thank you for telling me!

Your code smells a bit, for example why do you use a crazy polling interval of 0.01 , that helps nobody when you do that.
“Toast” type notifications will depend a lot on the app framework and platform, which are things you have not told us.

Use the default parameters,poll_frequency=0.5,it is failed that I retrieved the toast.Platform is android,toast is android system function.for example Android code:WindowManager.addView(TextView),the code can send message,What we see is toast!
Of course, app‘s toast is based on WindowManage fuction,The developers encapsulationed it.
now,I am using pytesseract model to recognize images,but Efficiency is slow,and it often goes wrong。
could you tell the way about get-toast ,and better is based on appium