Set up the {@link android.app.ActionBar}, if the API is available.
763286
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
    private void setupActionBar() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            // Show the Up button in the action bar.
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }
    }
463811
def init_app(self, app):
        """"""

        self.app = app
        self.app.apscheduler = self

        self._load_config()
        self._load_jobs()

        if self.api_enabled:
            self._load_api()
381576
def init_app(self, app):
        """"""
        app.add_url_rule(self.request_token_url, view_func=self.request_token,
                         methods=[u'POST'])
        app.add_url_rule(self.access_token_url, view_func=self.access_token,
                         methods=[u'POST'])
        app.add_url_rule(self.register_url, view_func=self.register,
                         methods=[u'GET', u'POST'])
        app.add_url_rule(self.authorize_url, view_func=self.authorize,
                         methods=[u'GET', u'POST'])
492529
private void setupActivityMonitor() {
		if(config.trackActivities){
			try {
				IntentFilter filter = null;
				activityMonitor = inst.addMonitor(filter, null, false);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
672428
function enable(app, route, repoDir){
  expressApp = app;
  routePfx = route;
  if(repoDir){
    reader.setRepoDir(repoDir);
  }
  app.post(route, androidUpdate.updater);

  app.get(route, function (req, res){
    res.send(reader.available());
  });
}
273810
private final void waitForActivityIfNotAvailable(){
		if(activityStack.isEmpty() || activityStack.peek().get() == null){

			if (activityMonitor != null) {
				Activity activity = activityMonitor.getLastActivity();
				while (activity == null){
					sleeper.sleepMini();
					activity = activityMonitor.getLastActivity();
				}
				addActivityToStack(activity);
			}
			else if(config.trackActivities){
				sleeper.sleepMini();
				setupActivityMonitor();
				waitForActivityIfNotAvailable();
			}
		}
	}
462874
private void showTitle(@Nullable final CharSequence title) {
        ActionBar actionBar = getSupportActionBar();

        if (actionBar != null) {
            if (isSplitScreen()) {
                if (toolbarLarge != null) {
                    toolbarLarge.setTitle(title);
                }

                actionBar.setTitle(null);
            } else {
                actionBar.setTitle(title);
            }
        }
    }
280913
public void display(String appName ) {
		waitUntilInputSizeIsKnown();
		this.appName = appName;
		window = ShowImages.showWindow(this,appName,true);
		window.setJMenuBar(menuBar);
	}
1011869
private void setActiveGUI( final boolean isEnabled ) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				toolbar.setEnabled(isEnabled);
				for( JComboBox b : algBoxes ) {
					b.setEnabled(isEnabled);
				}
				for( JComponent b : addedComponents ) {
					b.setEnabled(isEnabled);
				}
				imageBox.setEnabled(isEnabled);
			}
		});
	}
211428
public SetEnabledResponse setEnabled(Boolean saMLEnabled) throws ApiException {
        ApiResponse<SetEnabledResponse> resp = setEnabledWithHttpInfo(saMLEnabled);
        return resp.getData();
    }
611607
public void setToolbar(Toolbar toolBar) {
        mToolbar = toolBar;
        if (mBlurEngine != null) {
            mBlurEngine.setToolbar(toolBar);
        }
    }
1196324
public void setApiFramework(com.google.api.ads.admanager.axis.v201811.ApiFramework apiFramework) {
        this.apiFramework = apiFramework;
    }
474093
def init_app(self, app):
        """"""
        super(InvenioIIIFAPI, self).init_app(app)
        api = Api(app=app)
        self.iiif_ext.init_restful(api, prefix=app.config['IIIF_API_PREFIX'])
1013276
private void setupAppChooser() {
    // Configurator to choose the main application
    appCombo = new JComboBox<>();
    for(Class<?> clz : ELKIServiceRegistry.findAllImplementations(AbstractApplication.class)) {
      String nam = clz.getCanonicalName();
      if(nam == null || clz.getCanonicalName().contains("GUI")) {
        continue;
      }
      if(nam.startsWith(APP_PREFIX)) {
        nam = nam.substring(APP_PREFIX.length());
      }
      appCombo.addItem(nam);
    }
    appCombo.setEditable(true);
    String sel = maincls.getCanonicalName();
    if(sel.startsWith(APP_PREFIX)) {
      sel = sel.substring(APP_PREFIX.length());
    }
    appCombo.setSelectedItem(sel);
    appCombo.addActionListener((e) -> {
      if("comboBoxChanged".equals(e.getActionCommand())) {
        Class<? extends AbstractApplication> clz = ELKIServiceRegistry.findImplementation(AbstractApplication.class, (String) appCombo.getSelectedItem());
        if(clz != null) {
          maincls = clz;
          updateParameterTable();
        }
        else {
          LOG.warning("Main class name not found.");
        }
      }
    }
265454
function setApi() {
            self.api = {};
            if(process && process.env && process.env.APPVEYOR_API_URL) {
                var fullUrl = process.env.APPVEYOR_API_URL;

                var urlParts = fullUrl.split("/")[2].split(":");
                self.api = {
                    host: urlParts[0],
                    port: urlParts[1],
                    endpoint: "/api/tests/batch"
                };
            }
            else {
                throw Error("Not running in AppVeyor environment");
            }
        }
1232472
public void setApiKey(String apiKey) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof ApiKeyAuth) {
                ((ApiKeyAuth) auth).setApiKey(apiKey);
                return;
            }
        }
        throw new RuntimeException("No API key authentication configured!");
    }
361057
public void initNavDrawer(Toolbar appBar) {
		if (getActivityIf().isNavDrawerEnabled()) {
			navDrawer = getActivityIf().createNavDrawer(activity, appBar);
			navDrawer.init();
		}
	}