如下资料
http://www.android123.com.cn/androidkaifa/519.html
http://www.2cto.com/kf/201111/111395.html
http://android.tgbus.com/Android/tutorial/201103/347436.shtml
都无法正常退出,本人写了下列程序,本人程序在SDK2.2下通过
在baseAcitivity.java中写
public static List<Activity> activityList = new ArrayList<Activity>();
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
activityList.add(this);
}
在退出页面写:
首页把所有的activity finish掉,然后退出,
public class aa extends baseAcitivity{
if (strTitle.equalsIgnoreCase("退出"))
{
Log.d("activity count:", activityList.size()+"");
for (int i = 0; i < activityList.size(); i++)
{
if (null != activityList.get(i))
{
activityList.get(i).finish();
}
}
System.exit(0);
}
}