public void readPrefs(SharedPreferences settings,ActionFactory factory){
  boolean visible=false;
  String actionId=settings.getString("button_action_" + name + "_0","");
  mainAction=factory.getAction(actionId);
  if (mainAction != null)   visible=true;
  menuActions.clear();
  for (int i=0; i < maxMenuActions; i++) {
    actionId=settings.getString("button_action_" + name + "_"+ (i + 1),"");
    UIAction a=factory.getAction(actionId);
    if (a != null)     visible=true;
    menuActions.add(a);
  }
  if (button != null)   button.setVisibility(visible ? View.VISIBLE : View.GONE);
}

public void readPrefs ( SharedPreferences settings , ActionFactory factory ) { boolean visible = false ; String actionId = settings . getString ( "button_action_" + name + "_0" , "" ) ; mainAction = factory . getAction ( actionId ) ; if ( mainAction != null ) visible = true ; menuActions . clear ( ) ; for ( int i = 0 ; i < maxMenuActions ; i ++ ) { actionId = settings . getString ( "button_action_" + name + "_" + ( i + 1 ) , "" ) ; UIAction a = factory . getAction ( actionId ) ; if ( a != null ) visible = true ; menuActions . add ( a ) ; } if ( button != null ) button . setVisibility ( visible ? View . VISIBLE : View . GONE ) ; }
update button actions from preferences settings .
