Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

正常设置Toast可以显示,在网络请求回调中提示用户信息就不显示,是什么问题呢? #31

Open
liunans opened this issue Aug 7, 2019 · 1 comment

Comments

@liunans
Copy link

liunans commented Aug 7, 2019

正常设置Toast可以显示,在网络请求回调中提示用户信息就不显示,是什么问题呢?

@littlecurl
Copy link

你也没贴代码,也没贴日志。
猜测你网络请求开了新线程,导致Toast是在非UI线程运行的。
可以试试

runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(context, text, Toast.LENGTH_SHORT).show();
            }
        });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants