Back to project page MakeWithMotoSampleApp.
The source code is released under:
GNU General Public License
If you think the Android project MakeWithMotoSampleApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.makewithmoto.extras; //from w w w. j av a2 s.c o m import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Vector; public class WhatIsRunning { private static WhatIsRunning instance; protected WhatIsRunning() { } public static WhatIsRunning getInstance() { if (instance == null) instance = new WhatIsRunning(); return instance; } Vector<Object> runners = new Vector<Object>(); public void stopAll() { for (Object o : runners) { Method method = null; try { method = o.getClass().getMethod("stop"); } catch (SecurityException e) { } catch (NoSuchMethodException e) { } try { method.invoke(o); } catch (IllegalArgumentException e) { } catch (IllegalAccessException e) { } catch (InvocationTargetException e) { } } } public void add(Object object) { runners.add(object); } }