Code example for Field

Methods: setAccessiblegetDeclaringClassgetNamegetTypeset

0
                    fragment = fragmentFindFragmentByIdMethod.invoke(fragmentManagerProvider.get(), id);
                 
                else 
                    fragment = fragmentFindFragmentByTagMethod.invoke(fragmentManagerProvider.get(), injectFragment.tag());
 
                if (fragment == null && Nullable.notNullable(field))
                    throw new NullPointerException(String.format("Can't inject null value into %s.%s when field is not @Nullable", field.getDeclaringClass(), field.getName()));
 
                field.setAccessible(true);
                field.set(instance, fragment);
 
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
 
            } catch (InvocationTargetException e) {
                throw new RuntimeException( e );
 
            } catch (IllegalArgumentException f) {
                throw new IllegalArgumentException(String.format("Can't assign %s value %s to %s field %s", fragment != null ? fragment.getClass() : "(null)", fragment,
                        field.getType(), field.getName()), f);
            } 
        } 
 
         
        protected static void injectViews(Object activityOrFragment) {
Contextual code suggestions in your IDE  Get Codota for Java