public void addChild ( C child ) { SharedPreferences prefs = loadSharedPreferences ( "children" ) ; List < String > objects = getChildrenList ( ) ; Model toPut = ( Model ) child ; if ( objects . indexOf ( toPut . getId ( ) ) != ArrayUtils . INDEX_NOT_FOUND ) { return ; } objects . add ( toPut . getId ( ) ) ; toPut . save ( ) ; prefs . edit ( ) . putString ( String . valueOf ( getId ( ) ) , StringUtils . join ( objects , "," ) ) . commit ( ) ; }
Adds the object to the child ids list .