我正在尝试在连接处理程序类中实现 toast
public class server implements Runnable {
private static final String TAG = "myLogs";
.....
public void run()
{
.....
while (true) {
try {
client = server.accept();
// here i want to show message, when client is connected
Toast.makeText(getApplicationContext(), "msg msg", Toast.LENGTH_SHORT).show();
Log.d(TAG, "client connected....");
但我在 makeText 和 getApplicationContext() 上遇到错误;他们有下划线..