public static final int setting=0x7f030004;
}
public static final class string {
- public static final int ErrorLogin=0x7f050024;
- public static final int ErrorSystem=0x7f050025;
- public static final int ErrorUpdate=0x7f050023;
+ public static final int ErrorLogin=0x7f050027;
+ public static final int ErrorSystem=0x7f050028;
+ public static final int ErrorUpdate=0x7f050026;
public static final int MenuAdd=0x7f05001f;
public static final int MenuCut=0x7f05001d;
public static final int MenuDelete=0x7f050020;
public static final int app_name=0x7f050000;
public static final int cancelButton=0x7f050003;
public static final int closeButton=0x7f050004;
- public static final int dialogErrorTitle=0x7f050026;
- public static final int dialogSystemError=0x7f050027;
+ public static final int dialogErrorTitle=0x7f050023;
+ public static final int dialogSystemError=0x7f050024;
public static final int mainAddMsg=0x7f050008;
public static final int mainConfirmMsg=0x7f050006;
public static final int mainConfirmTitle=0x7f050005;
public static final int settingUpdateMsg=0x7f05000f;
public static final int settingUpdateTimeTitle=0x7f05001c;
public static final int settingUpdateTitle=0x7f05001a;
- public static final int toastSystem=0x7f050028;
+ public static final int toastSystem=0x7f050025;
public static final int yesButton=0x7f050001;
}
}
dao.updateSelected(item, selected);\r
}\r
catch (Exception e){\r
- EfException.msg(R.string.ErrorSystem);\r
+ EfException.msg(R.string.ErrorSystem, e);\r
}\r
}\r
});\r
leftButton.setTextSize(fSize);
rightButton.setTextSize(fSize);
} catch (Exception e) {
- EfException.msg(R.string.ErrorSystem);
+ EfException.msg(R.string.ErrorSystem, e);
}
}
NodeDao dao = (NodeDao) NodeCacheDao.getInstance();
top = dao.searchRoot();
if (top == null) {
- EfException.msg(R.string.ErrorSystem);
+ EfException.msg(R.string.ErrorSystem, new EfException(
+ EfError.SYSTEM));
return;
}
updateList(top);
db.endTransaction();
}
} catch (EfException e) {
- EfException.msg(R.string.ErrorSystem);
+ EfException.msg(R.string.ErrorSystem, e);
} finally {
updateList();
}
updateList();
} catch (EfException e) {
- EfException.msg(R.string.ErrorSystem);
+ EfException.msg(R.string.ErrorSystem, e);
}
}
leftButton.setEnabled(false);
rightButton.setEnabled(false);
}
- } catch (Throwable e) {
- EfException.msg(R.string.ErrorSystem);
+ } catch (Exception e) {
+ EfException.msg(R.string.ErrorSystem, e);
}
}
isInit = false;
} catch (Exception e) {
- EfException.msg(R.string.ErrorSystem);
+ EfException.msg(R.string.ErrorSystem, e);
throw new EfException(EfError.INIT);
}
}
}
public static void msg(int id){
+ msg(id, null);
+ }
+
+ public static void msg(int id, Exception e){
String msg = Initialize.getContext().getString(id);
+ if (e != null){
+ msg += getMessageInfo(e);
+ }
msg(msg);
}
-
+
public static void msg(String msg){
+ msg(msg, null);
+ }
+
+ public static void msg(String msg, Exception e){
+ if (e != null){
+ msg += getMessageInfo(e);
+ }
Intent intent = new Intent(Constant.ACTION_MESSAGE);
intent.putExtra(Constant.ACTION_MESSAGE_MESSAGE, msg);
Initialize.getContext().sendBroadcast(intent);
}
-
+
public static void msg(Context context, String msg) {
+ msg(context, msg, null);
+ }
+
+ public static void msg(Context context, String msg, Exception e) {
+ if (e != null){
+ msg += getMessageInfo(e);
+ }
Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
}
+
+ public static String getMessageInfo(Exception e){
+ StackTraceElement[] st = e.getStackTrace();
+ StackTraceElement elem = st[0];
+ String clazz = elem.getClassName();
+ String method = elem.getMethodName();
+ int line = elem.getLineNumber();
+
+ return " [" + clazz + " " + method + "() " + line + "]";
+ }
}