|
@@ -303,15 +303,19 @@ public class Jump2View {
|
|
|
* 跳到登录页面
|
|
* 跳到登录页面
|
|
|
*
|
|
*
|
|
|
* @param context
|
|
* @param context
|
|
|
- * @param o
|
|
|
|
|
|
|
+ * @param from
|
|
|
*/
|
|
*/
|
|
|
- public synchronized void goLoginView(Context context, String o) {
|
|
|
|
|
|
|
+ public synchronized void goLoginView(Context context, String from) {
|
|
|
Intent intent = new Intent(context, LoginAct.class);
|
|
Intent intent = new Intent(context, LoginAct.class);
|
|
|
- intent.putExtra("where_from", o);
|
|
|
|
|
|
|
+ intent.putExtra("where_from", from);
|
|
|
if (!(context instanceof Activity)) {
|
|
if (!(context instanceof Activity)) {
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
- } else if (!TextUtils.isEmpty(o)) {
|
|
|
|
|
- ((Activity) context).finish();
|
|
|
|
|
|
|
+ } else if (!TextUtils.isEmpty(from)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ ((Activity) context).finish();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
context.startActivity(intent);
|
|
context.startActivity(intent);
|
|
|
}
|
|
}
|
|
@@ -1502,17 +1506,15 @@ public class Jump2View {
|
|
|
gotoLoginAgain("");
|
|
gotoLoginAgain("");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void gotoLoginAgain(String o) {
|
|
|
|
|
|
|
+ public void gotoLoginAgain(String msg) {
|
|
|
String token = SpUtils.getToken(SheepApp.getInstance());
|
|
String token = SpUtils.getToken(SheepApp.getInstance());
|
|
|
if (TextUtils.isEmpty(token)) {
|
|
if (TextUtils.isEmpty(token)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
SpUtils.saveToken(SheepApp.getInstance(), "");
|
|
SpUtils.saveToken(SheepApp.getInstance(), "");
|
|
|
DataUtil.getInstance().clearData();
|
|
DataUtil.getInstance().clearData();
|
|
|
- G.showToast(TextUtils.isEmpty(o) ? "登录信息已过期,请重新登录" : o);
|
|
|
|
|
- Intent intent = new Intent(SheepApp.getInstance(), ActMain.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
|
|
- intent.putExtra("INTENT_ACTION", "LOGOUT");
|
|
|
|
|
- SheepApp.getInstance().startActivity(intent);
|
|
|
|
|
|
|
+ G.showToast(TextUtils.isEmpty(msg) ? "登录信息已过期,请重新登录" : msg);
|
|
|
|
|
+ goLoginView(SheepApp.getInstance().getCurrentActivity(), "other");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void gotoGuide(final Activity activity) {
|
|
public void gotoGuide(final Activity activity) {
|