0

最近我需要修改一个程序以添加一些新功能。该程序用于收集手机周围的信息并将其发送到用户定义的服务器或将数据存储在 SD 卡上。但是如果我们不自己设置服务器主机,app运行时会每5秒显示一次toast localhost/127.0.0.1:5001 – Connection refused:.

有谁知道我怎么知道这个吐司来自哪里?由于代码中有很多地方,我们有一个toast.show().

提前致谢!
这是可能导致问题的代码片段。

/**
     * Update GPS Status
     */
    public void updateGpsStatus(Context context, Handler handler) {
        try {
            LocationManager locationManager = (LocationManager) context
                    .getSystemService(Context.LOCATION_SERVICE);
            this.gpsStatus = locationManager
                    .isProviderEnabled(LocationManager.GPS_PROVIDER);
        } catch (Exception e) {
            if (handler == null) {
                ComFunc.showToast(context, e.getMessage());
            } else {
                ComFunc.showToast(context, e.getMessage(), handler);
            }
            e.printStackTrace();
        }
    }
4

2 回答 2

1

将所有更改toast.showfoofoo检查流氓字符串,如果它在那里转到您的断点。

于 2011-05-29T23:04:08.540 回答
0

很难推测,因为我们不知道您在说什么程序。

但是,我的第一次尝试是搜索我的源代码localhost/127.0.0.1:5001 – Connection refused并找到它的使用位置。

可能会生成主机名/IP,所以也尝试搜索– Connection refused

于 2011-04-10T09:53:56.110 回答