吐司从哪里来?

时间:2011-04-10 09:50:39

标签: android toast

最近我需要修改一个程序以添加一些新功能。该程序用于收集移动设备周围的信息并将其发送到用户定义的服务器或将数据存储在SD卡上。但是如果我们不自己设置服务器主机,那么应用程序将在运行时每隔5秒显示一次祝酒: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();
        }
    }

2 个答案:

答案 0 :(得分:1)

将所有toast.show更改为foo,并在foo中检查流氓字符串,如果它出现在您的断点处。

答案 1 :(得分:0)

很难推测,因为我们不知道你在说什么节目。

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

可能会生成主机名/ IP,因此也请尝试搜索– Connection refused

相关问题