src/main/java/de/blau/android/propertyeditor/tagform/DialogRow.java
/**
     * Unwrap a Context till we find a FragmentActivity
     * 
     * @param context the Context
     * @return the unwrapped Context
     */
Unwrap a Context till we find a FragmentActivity

@param context the Context
@return the unwrapped Context
Unwrap a Context till we find a FragmentActivity @param context the Context @return the unwrapped Context
@NonNull
    private static Context unwrap(@NonNull Context context) {
        while (!(context instanceof FragmentActivity)) {
            if (context instanceof ContextThemeWrapper) {
                context = ((ContextThemeWrapper) context).getBaseContext();
            } else if (context instanceof android.view.ContextThemeWrapper) {
                context = ((android.view.ContextThemeWrapper) context).getBaseContext();
            } else {
                break;
            }
        }
        return context;
    }
@ NonNull private static Context unwrap ( @ NonNull Context context ) { while ( ! ( context instanceof FragmentActivity ) ) { if ( context instanceof ContextThemeWrapper ) { context = ( ( ContextThemeWrapper ) context ) . getBaseContext ( ) ; } else if ( context instanceof android . view . ContextThemeWrapper ) { context = ( ( android . view . ContextThemeWrapper ) context ) . getBaseContext ( ) ; } else { break ; } } return context ; }
Unwrap a Context till we find a FragmentActivity
Unwrap a Context till we find a FragmentActivity