Explorar el Código

奔溃bug修改

huyuguo %!s(int64=5) %!d(string=hace) años
padre
commit
551c509aee

+ 3 - 0
app/src/main/java/com/electric/chargingpile/activity/RoutePlanMapActivity.java

@ -10,6 +10,7 @@ import android.content.pm.PackageManager;
10 10
import android.database.Cursor;
11 11
import android.database.sqlite.SQLiteDatabase;
12 12
import android.database.sqlite.SQLiteDatabaseLockedException;
13
import android.database.sqlite.SQLiteException;
13 14
import android.graphics.Bitmap;
14 15
import android.graphics.Canvas;
15 16
import android.graphics.Matrix;
@ -1264,6 +1265,8 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1264 1265
            }
1265 1266
        } catch (SQLiteDatabaseLockedException e) {
1266 1267
            e.printStackTrace();
1268
        } catch (SQLiteException e) {
1269
            e.printStackTrace();
1267 1270
        } finally {
1268 1271
            daoSession.clear();
1269 1272
            zhan_listDao.detachAll();

+ 14 - 3
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -335,7 +335,9 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
335 335
        OkHttpUtils.get().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
336 336
            @Override
337 337
            public void onError(Call call, Exception e) {
338
                loadingDialog.dismiss();
338
                if (loadingDialog != null) {
339
                    loadingDialog.dismiss();
340
                }
339 341
                if (page == 1) {
340 342
                    xRefreshView.stopRefresh();
341 343
                } else {
@ -347,7 +349,9 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
347 349
348 350
            @Override
349 351
            public void onResponse(String response) {
350
                loadingDialog.dismiss();
352
                if (loadingDialog != null) {
353
                    loadingDialog.dismiss();
354
                }
351 355
                if (page == 1) {
352 356
                    xRefreshView.stopRefresh();
353 357
                } else {
@ -392,7 +396,14 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
392 396
393 397
    @Override
394 398
    public void onDestroy() {
395
        super.onDestroy();
399
        try {
400
            loadingDialog.dismiss();
401
        } catch (Exception e) {
402
            e.printStackTrace();
403
        }
404
396 405
        ChatBeanLab.get(getContext()).clear();
406
        super.onDestroy();
407
397 408
    }
398 409
}

+ 5 - 1
app/src/main/java/com/electric/chargingpile/fragment/MonthListFragment.java

@ -1,5 +1,6 @@
1 1
package com.electric.chargingpile.fragment;
2 2
3
import android.app.Activity;
3 4
import android.content.Intent;
4 5
import android.os.Bundle;
5 6
import android.support.v4.app.Fragment;
@ -103,7 +104,10 @@ public class MonthListFragment extends Fragment {
103 104
                    @Override
104 105
                    public void onError(Call call, Exception e) {
105 106
                        dialog.cancel();
106
                        ToastUtil.showToast(getActivity(), "请检查您的网络", Toast.LENGTH_SHORT);
107
                        Activity activity = getActivity();
108
                        if (activity != null) {
109
                            ToastUtil.showToast(activity, "请检查您的网络", Toast.LENGTH_SHORT);
110
                        }
107 111
                    }
108 112
109 113
                    @Override