Java tutorial
//package com.java2s; import java.lang.reflect.Method; import android.bluetooth.BluetoothDevice; public class Main { public static boolean cancelBondProcess(Class btClass, BluetoothDevice device) throws Exception { Method createBondMethod = btClass.getMethod("cancelBondProcess"); Boolean retVal = (Boolean) createBondMethod.invoke(device); return retVal.booleanValue(); } }