Code example for Constructor

Methods: isAccessible, setAccessible

0
	} 
	 
	private static Constructor<?> getConstructor(Class<?> cls, Class<?>[] args) {
		try { 
			Constructor<?> c = cls.getDeclaredConstructor(args);
			if (!c.isAccessible())
				c.setAccessible(true);
			return c;
		} catch (Exception ex) {
			return null; 
		} 
	} 
	 
	public static void ActivateBluetooth(Context c, View v) {
		try { 
			//Play nice and use the system dialog for this 
			c.startActivity(new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE));
		} catch (ActivityNotFoundException ax) {
			ManualAskBluetoothActivate(c, v);
		} catch (AndroidRuntimeException ax) {
			ManualAskBluetoothActivate(c, v);