Here you can find the source of setNavigationSelected(Activity activity, ArrayAdapter
public static boolean setNavigationSelected(Activity activity, ArrayAdapter<String> adapter, String selected)
//package com.java2s; import android.app.ActionBar; import android.app.Activity; import android.widget.ArrayAdapter; public class Main { public static boolean setNavigationSelected(Activity activity, ArrayAdapter<String> adapter, String selected) { ActionBar actionBar = activity.getActionBar(); if (actionBar != null) { int setPosition = adapter.getPosition(selected); actionBar.setSelectedNavigationItem(setPosition); return true; }/*from w ww. j a v a 2s .co m*/ return false; } }