Android examples for java.lang.reflect:Method Invoke
safe Call Method Without Result
import android.util.Log; import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; public class Main{ static private final String TAG = ReflectionUtils.class.getSimpleName(); @SuppressWarnings("unchecked") public static void safeCallMethodWithoutResult(Object object, Method method, Object... args) { try {/* w ww .j ava2 s .c om*/ method.invoke(object, args); } catch (Exception ex) { Log.w(TAG, ex); } } }