解决冲突

This commit is contained in:
wds
2021-06-03 18:18:40 +08:00
22 changed files with 168 additions and 52 deletions

View File

@@ -24,6 +24,8 @@ public class MainActivity extends BaseActivity {
@Override
protected void initData() {
super.initData();
new CountDownTimer(3000, 1000) {
@Override
public void onTick(long l) {

View File

@@ -9,6 +9,8 @@ import com.lzy.okgo.cookie.CookieJarImpl;
import com.lzy.okgo.cookie.store.DBCookieStore;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import com.lzy.okgo.model.HttpHeaders;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.umcrash.UMCrash;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
@@ -23,6 +25,15 @@ public class UserApplication extends Application {
public void onCreate() {
super.onCreate();
userApplication=this;
UMConfigure.init(this, "60b885bd6c421a3d97db55e6", "navinfo", UMConfigure.DEVICE_TYPE_PHONE, "");
/**
*设置组件化的Log开关
*参数: boolean 默认为false如需查看LOG设置为true
*/
UMConfigure.setLogEnabled(true);
String e ="测试自定义异常代码是否运行!!!!!!";
UMCrash.generateCustomLog(e,"UmengException");
initOkGo();
}
@@ -66,6 +77,8 @@ public class UserApplication extends Application {
.addCommonHeaders(headers)
//全局统一超时重连次数默认为三次那么最差的情况会请求4次(一次原始请求,三次重连请求)不需要可以设置为0;
.setRetryCount(0);
}
}

View File

@@ -117,4 +117,5 @@ public abstract class BaseActivity extends AppCompatActivity {
}
}
}

View File

@@ -20,6 +20,7 @@ import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.umeng.umcrash.UMCrash;
import org.json.JSONObject;
@@ -108,6 +109,11 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
dismissLoadingDialog();
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
/**
* 友盟+
* 返回自定义报错信息
*/
UMCrash.generateCustomLog("网络请求报错-位置CapacityEvaluationFragment"+e.getMessage(),"UmengException");
}
}).build();
}

View File

@@ -20,6 +20,7 @@ import com.navinfo.outdoor.bean.TaskExplainInfo;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.umeng.umcrash.UMCrash;
import org.json.JSONObject;
@@ -73,6 +74,8 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
@Override
protected void initView() {
super.initView();
ivIssueFinish =findViewById(R.id.iv_issue_finish);
mainIssueRecycler =findViewById(R.id.main_issue_recycler);
ivIssueFinish.setOnClickListener(this::onClick);

View File

@@ -17,7 +17,7 @@ import static android.app.Activity.RESULT_OK;
/**
* 实名认证
*/
public class UserAttestationFragment extends BaseFragment implements View.OnClickListener{
public class UserAttestationFragment extends BaseFragment implements View.OnClickListener {
private ImageView ivAttestation2;
private ImageView ivAttestation1;
@@ -46,30 +46,31 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
@Override
public void onClick(View v) {
switch (v.getId()){
switch (v.getId()) {
case R.id.iv_attestation:
getActivity().finish();
break;
case R.id.iv_attestation1:
Intent ivAttestation1 = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(ivAttestation1,100);
startActivityForResult(ivAttestation1, 100);
break;
case R.id.iv_attestation2:
Intent ivAttestation2 = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(ivAttestation2,200);
startActivityForResult(ivAttestation2, 200);
break;
}
}
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode==100&&resultCode==RESULT_OK){
Bundle extras=data.getExtras();//从Intent中获取附加值
Bitmap bitmap=(Bitmap) extras.get("data");//从附加值中获取返回的图像
if (requestCode == 100 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
ivAttestation1.setImageBitmap(bitmap);//显示图像
}else if (requestCode==200&&resultCode==RESULT_OK){
Bundle extras=data.getExtras();//从Intent中获取附加值
Bitmap bitmap=(Bitmap) extras.get("data");//从附加值中获取返回的图像
} else if (requestCode == 200 && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();//从Intent中获取附加值
Bitmap bitmap = (Bitmap) extras.get("data");//从附加值中获取返回的图像
ivAttestation2.setImageBitmap(bitmap);//显示图像
}
}

View File

@@ -6,6 +6,7 @@ import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.PostRequest;
import com.umeng.umcrash.UMCrash;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -195,6 +196,11 @@ public class OkGoBuilder<T> {
if (throwable != null) {
throwable.printStackTrace();
callback.onError(throwable, 2);
/**
* 友盟+
* 使用自定义错误,查看时请在错误列表页面选择【自定义异常】
*/
UMCrash.generateCustomLog("网络请求报错-位置OKGOBuilder"+throwable,"UmengException");
}
}
});