Share via


TabWidget.FocusCurrentTab(Int32) Method

Definition

Sets the current tab and focuses the UI on it.

[Android.Runtime.Register("focusCurrentTab", "(I)V", "GetFocusCurrentTab_IHandler")]
public virtual void FocusCurrentTab (int index);
[<Android.Runtime.Register("focusCurrentTab", "(I)V", "GetFocusCurrentTab_IHandler")>]
abstract member FocusCurrentTab : int -> unit
override this.FocusCurrentTab : int -> unit

Parameters

index
Int32

The tab that you want focused (highlighted in orange) and selected (tab brought to the front of the widget)

Attributes

Remarks

Sets the current tab and focuses the UI on it. This method makes sure that the focused tab matches the selected tab, normally at #setCurrentTab. Normally this would not be an issue if we go through the UI, since the UI is responsible for calling TabWidget.onFocusChanged(), but in the case where we are selecting the tab programmatically, we'll need to make sure focus keeps up.

Java documentation for android.widget.TabWidget.focusCurrentTab(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also