Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通过接收器消息broadcast Receiver并显示它Toast。但我想在我的Activity. 大家帮帮我?谢谢!!
broadcast Receiver
Toast
Activity
您可以在您的活动中添加一个 TextView,然后使用TextView.setText()方法来显示您收到的消息。
TextView.setText()
是的,收到消息后只需启动另一个活动,Braodcast 接收器不是活动,因此您不能直接从那里显示内容。