Buggy code:
public class TemplateActivity extends BaseActivity { private Toolbar toolbar ; private ColorGenerator mColorGenerator = ColorGenerator . MATERIAL ; private IBuilder mDrawableBuilder ; private Context mContext = this ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; super . setContentView ( activity_template ) ; toolbar = ( ( Toolbar ) ( findViewById ( R . id . toolbar ) ) ) ; if ( ( toolbar ) != null ) { toolbar . setTitle ( ( "" + ( ( ( com . buildmlearn . application . MyApplication ) ( getApplication ( ) ) ) . getmModel ( ) . getmTemplate ( ) ) ) ) ; setSupportActionBar ( toolbar ) ; toolbar . setNavigationIcon ( ic_menu_back ) ; } else Log . e ( "toolbar<seq2seq4repair_space>" , "null" ) ; toolbar . setNavigationOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Log . e ( "back" , "called" ) ; onBackPressed ( ) ; } } ) ; Fragment fragment = new MetaDataFragment ( ) ; FragmentManager fragmentManager = getSupportFragmentManager ( ) ; fragmentManager . beginTransaction ( ) . replace ( frame , fragment ) . commit ( ) ; mDrawableBuilder = TextDrawable . builder ( ) . round ( ) ; TextDrawable drawable = mDrawableBuilder . build ( "" , Color . parseColor ( "#e81e61" ) ) ; final ImageView fabIconNew = new ImageView ( this ) ; fabIconNew . setImageDrawable ( getResources ( ) . getDrawable ( ic_menu_close_clear_cancel ) ) ; <START_BUG> final FloatingActionButton rightLowerButton = new FloatingActionButton . Builder ( this ) . setContentView ( fabIconNew ) . setBackgroundDrawable ( drawable ) . build ( ) ; <END_BUG> SubActionButton . Builder rLSubBuilder = new SubActionButton . Builder ( this ) ; ImageView rlIcon1 = new ImageView ( this ) ; ImageView rlIcon2 = new ImageView ( this ) ; ImageView rlIcon3 = new ImageView ( this ) ; ImageView rlIcon4 = new ImageView ( this ) ; rlIcon1 . setImageDrawable ( getResources ( ) . getDrawable ( ic_menu_add ) ) ; rlIcon2 . setImageDrawable ( getResources ( ) . getDrawable ( ic_menu_agenda ) ) ; rlIcon3 . setImageDrawable ( getResources ( ) . getDrawable ( ic_menu_share ) ) ; rlIcon4 . setImageDrawable ( getResources ( ) . getDrawable ( ic_menu_help ) ) ; final FloatingActionMenu rightLowerMenu = new FloatingActionMenu . Builder ( this ) . addSubActionView ( rLSubBuilder . setContentView ( rlIcon1 ) . setBackgroundDrawable ( drawable ) . build ( ) ) . addSubActionView ( rLSubBuilder . setContentView ( rlIcon2 ) . build ( ) ) . addSubActionView ( rLSubBuilder . setContentView ( rlIcon3 ) . build ( ) ) . addSubActionView ( rLSubBuilder . setContentView ( rlIcon4 ) . build ( ) ) . attachTo ( rightLowerButton ) . build ( ) ; rightLowerMenu . setStateChangeListener ( new FloatingActionMenu . MenuStateChangeListener ( ) { @ Override public void onMenuOpened ( FloatingActionMenu menu ) { fabIconNew . setRotation ( 0 ) ; PropertyValuesHolder pvhR = PropertyValuesHolder . ofFloat ( ROTATION , 45 ) ; ObjectAnimator animation = ObjectAnimator . ofPropertyValuesHolder ( fabIconNew , pvhR ) ; animation . start ( ) ; } @ Override public void onMenuClosed ( FloatingActionMenu menu ) { fabIconNew . setRotation ( 45 ) ; PropertyValuesHolder pvhR = PropertyValuesHolder . ofFloat ( ROTATION , 0 ) ; ObjectAnimator animation = ObjectAnimator . ofPropertyValuesHolder ( fabIconNew , pvhR ) ; animation . start ( ) ; } } ) ; rlIcon1 . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent i = new Intent ( getApplicationContext ( ) , MainActivity . class ) ; startActivity ( i ) ; finish ( ) ; rightLowerMenu . close ( true ) ; } } ) ; rlIcon2 . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent i = new Intent ( getApplicationContext ( ) , MainActivity . class ) ; startActivity ( i ) ; finish ( ) ; rightLowerMenu . close ( true ) ; } } ) ; rlIcon3 . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent sendIntent = new Intent ( ) ; sendIntent . setAction ( ACTION_SEND ) ; sendIntent . putExtra ( EXTRA_TEXT , "Hi<seq2seq4repair_space>I<seq2seq4repair_space>am<seq2seq4repair_space>using<seq2seq4repair_space>BuildmLearn<seq2seq4repair_space>Toolkit<seq2seq4repair_space>-<seq2seq4repair_space>An<seq2seq4repair_space>initiative<seq2seq4repair_space>by<seq2seq4repair_space>BuildmLearn<seq2seq4repair_space>.You<seq2seq4repair_space>must<seq2seq4repair_space>also<seq2seq4repair_space>try<seq2seq4repair_space>https:////play.google.com//store//apps//details?id=org.buildmlearn.learnfrommap" ) ; sendIntent . setType ( "text//plain" ) ; startActivity ( sendIntent ) ; rightLowerMenu . close ( true ) ; } } ) ; rlIcon4 . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { new MaterialDialog . Builder ( mContext ) . title ( "Welcome<seq2seq4repair_space>to<seq2seq4repair_space>Help" ) . content ( help_text ) . positiveText ( agree ) . positiveColorRes ( primaryColor ) . negativeColorRes ( primaryColor ) . titleGravity ( CENTER ) . titleColorRes ( primaryColor ) . contentColorRes ( white ) . backgroundColorRes ( material_blue_grey_800 ) . dividerColorRes ( status_bar ) . btnSelector ( md_btn_selector_custom , POSITIVE ) . positiveColor ( WHITE ) . negativeColorAttr ( textColorSecondaryInverse ) . theme ( LIGHT ) . callback ( new MaterialDialog . ButtonCallback ( ) { @ Override public void onPositive ( MaterialDialog dialog ) { } } ) . show ( ) ; rightLowerMenu . close ( true ) ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onBackPressed ( ) { } }

Fix:
final FloatingActionButton rightLowerButton = new FloatingActionButton . Builder ( this ) . setContentView ( fabIconNew ) . setBackgroundDrawable ( fab_selector ) . build ( ) ;