packages/modules/Wifi/service/java/com/android/server/wifi/ClientModeImpl.java:5087: error: no suitable constructor found for Intent(int) Intent intent = new Intent(WifiMonitor.NETWORK_NOT_FOUND_EVENT); ^ constructor Intent.Intent(Intent) is not applicable (argument mismatch; int cannot be converted to Intent) constructor Intent.Intent(String) is not applicable (argument mismatch; int cannot be converted to String)
时间: 2024-02-20 09:57:11 浏览: 173
这个错误提示是因为在该代码中,Intent构造函数需要传入一个String类型的参数,而你传入了一个int类型的参数。你需要将该代码改为以下代码来解决这个错误:
```
Intent intent = new Intent(WifiMonitor.NETWORK_NOT_FOUND_EVENT);
```
改为:
```
Intent intent = new Intent();
intent.setAction(WifiMonitor.NETWORK_NOT_FOUND_EVENT);
```
这样就会调用Intent的无参构造函数,并通过setAction()方法设置Intent的Action为NETWORK_NOT_FOUND_EVENT。
阅读全文