public class ActivityLifeCycleManager extends Application{
private List<Activity> activityList=null;
private static ActivityLifeCycleManager instance;
//private IPodManager mIPodManager=null;
private ActivityLifeCycleManager(){
activityList=new LinkedList<Activity>();
//mIPodManager = (IPodManager)getSystemService("ipod");
}
public static ActivityLifeCycleManager getInstance(){
if(null==instance){
instance=new ActivityLifeCycleManager();
}
return instance;
}
public void addActivity(Activity activity){
if(activityList!=null && activityList.size()>0){
if(!activityList.contains(activity)){
activityList.add(activity);
}
}else{
activityList.add(activity);
}
}
public void exit(){
//mIPodManager.stop();
if(activityList!=null && activityList.size()>0){
for(Activity activity:activityList){
activity.finish();
}
}
System.exit(0);
}
}
private List<Activity> activityList=null;
private static ActivityLifeCycleManager instance;
//private IPodManager mIPodManager=null;
private ActivityLifeCycleManager(){
activityList=new LinkedList<Activity>();
//mIPodManager = (IPodManager)getSystemService("ipod");
}
public static ActivityLifeCycleManager getInstance(){
if(null==instance){
instance=new ActivityLifeCycleManager();
}
return instance;
}
public void addActivity(Activity activity){
if(activityList!=null && activityList.size()>0){
if(!activityList.contains(activity)){
activityList.add(activity);
}
}else{
activityList.add(activity);
}
}
public void exit(){
//mIPodManager.stop();
if(activityList!=null && activityList.size()>0){
for(Activity activity:activityList){
activity.finish();
}
}
System.exit(0);
}
}