Code example for Constructor

Methods: isAccessiblesetAccessible

	private static Constructor<?> getConstructor(Class<?> cls, Class<?>[] args) {
		try { 
			Constructor<?> c = cls.getDeclaredConstructor(args);
			if (!c.isAccessible())
			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) {
Contextual code suggestions in your IDE  Get Codota for Java