异常(栈里必须有activity的flag标识): 05-02 08:43:36.173: E/AndroidRuntime(3328): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? 解决办法: Inte…
栈解旋(unwinding) 异常被抛出后,从进入try块起,到异常被抛掷前,这期间在栈上的构造的所有对象,都会被自动析构.析构的顺序与构造的顺序相反.这一过程称为栈的解旋(unwinding). demo 1 #include <iostream> #include <cstdio> using namespace std; class MyException {}; class Test { public: Test(int a = 0, int b = 0) { this-&…