Commit e53f2442 authored by jianglx's avatar jianglx

修改唤醒页面

parent dc8cf5bd
...@@ -56,8 +56,9 @@ public class RvClientApplication extends FrameApp { ...@@ -56,8 +56,9 @@ public class RvClientApplication extends FrameApp {
ShareInstall.getInstance().init(this); ShareInstall.getInstance().init(this);
ShareInstall.getInstance().reportRegister(); ShareInstall.getInstance().reportRegister();
} }
LogUtil.setLogEnable(true, getApplicationContext()); LogUtil.setLogEnable(false, getApplicationContext());
CrashHandler.getInstance().init(getApplicationContext());
// CrashHandler.getInstance().init(getApplicationContext());
// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext // 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext
SDKInitializer.initialize(this); SDKInitializer.initialize(this);
//自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型. //自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型.
......
...@@ -34,33 +34,29 @@ public class WakeUpActivity extends AppCompatActivity { ...@@ -34,33 +34,29 @@ public class WakeUpActivity extends AppCompatActivity {
ShareInstall.getInstance().getInfo(intent, listener); ShareInstall.getInstance().getInfo(intent, listener);
} }
private AppGetInfoListener listener = new AppGetInfoListener() { private AppGetInfoListener listener = info -> {
@Override LogUtil.d("ShareInstall", "info = " + info);
public void onGetInfoFinish(String info) { Intent intent = new Intent(getApplicationContext(), MainActivity.class);
LogUtil.d("ShareInstall", "info = " + info); if (info.contains("code"))
if (info.contains("code")) try {
try { JSONObject object = new JSONObject(info);
JSONObject object = new JSONObject(info); String inviteCode = object.optString("code");
String inviteCode = object.optString("code"); if (!TextUtils.isEmpty(inviteCode)) {
if (!TextUtils.isEmpty(inviteCode)) { Cookie.save(getApplicationContext(), "code", inviteCode);
Cookie.save(getApplicationContext(), "code", inviteCode);
}
String url = object.optString("url");
LogUtil.d("唤醒传过来的url=" + url);
String title = URLDecoder.decode(object.optString("title"), "UTF-8");
LogUtil.d("唤醒传过来的tile=" + title);
if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(title)) {
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.putExtra("to", "webView");
intent.putExtra("url", url);
intent.putExtra("title", title);
startActivity(intent);
finish();
}
} catch (Exception e) {
e.printStackTrace();
} }
String url = object.optString("url");
} LogUtil.d("唤醒传过来的url=" + url);
String title = URLDecoder.decode(object.optString("title"), "UTF-8");
LogUtil.d("唤醒传过来的tile=" + title);
if (!TextUtils.isEmpty(url) && !TextUtils.isEmpty(title)) {
intent.putExtra("to", "webView");
intent.putExtra("url", url);
intent.putExtra("title", title);
}
} catch (Exception e) {
e.printStackTrace();
}
startActivity(intent);
finish();
}; };
} }
...@@ -1066,11 +1066,9 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -1066,11 +1066,9 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
CityPickerBean bean = new Gson().fromJson(json, CityPickerBean.class); CityPickerBean bean = new Gson().fromJson(json, CityPickerBean.class);
for (CityPickerBean.CityBean cityBean : bean.getCity()) { for (CityPickerBean.CityBean cityBean : bean.getCity()) {
for (ListsBean lsBean : cityBean.getLists()) { for (ListsBean lsBean : cityBean.getLists()) {
if (starCity.equals(lsBean.getName())) { if (!TextUtils.isEmpty(starCity) && starCity.equals(lsBean.getName())) {
dataBean.setStartCity(lsBean.getId()); dataBean.setStartCity(lsBean.getId());
} } else if (!TextUtils.isEmpty(endCity) && endCity.equals(lsBean.getName())) {
if (endCity.equals(lsBean.getName())) {
dataBean.setEndCity(lsBean.getId()); dataBean.setEndCity(lsBean.getId());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment