Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伙计们,android中错误处理的最佳选择是什么。总而言之,我不希望我的应用程序在第一次尝试时关闭。说它开始了,发出了一个http请求,错误并关闭了。我正在寻找一个警告类型错误,并让它继续进一步的功能。提前致谢。
当尝试打印堆栈跟踪时,您应该始终使用它:
try { // DO STUFF } catch (Exception e) { Log.e(TAG, Log.getStackTraceString(e); }
try { //Code } catch (Exception e) { System.out.println(e); }
尝试Log.e(String, String);
Log.e(String, String);
应该为你工作