[JAVA] Browse an instance of Tab's View on Android

Hello sekitaka.

I had to set the highlight of Showcase View (https://github.com/amlcurran/ShowcaseView) on the tab in the Android app. To set ShowcaseView highlighting, I needed to specify an instance of the View of interest, and I looked at how to get an instance (of a subclass of View) for each Tab.

TabLayout tabLayout = (TabLayout)findViewById(R.id.tab_layout);
ViewGroup viewGroup = (ViewGroup)tablayout.getChildAt(0); //0 can be fixed
int tabPosition = 0; //Index of the tab you want to get
View tabView = viewGroup.getChildAt(tabPosition); //Get a View instance of a tab

Recommended Posts

Browse an instance of Tab's View on Android
About an instance of java
How to "hollow" View on Android
Android view
Display View on other apps on Android (Summary of support methods by API version)
Build a Laravel environment on an AWS instance
I tried installing docker on an EC2 instance
Install docker-compose on a Graviton 2 instance of AWS EC2
[Android] Always detect ON / OFF switching of Bluetooth headset
I saw the list view of Android development collectively
Mutual conversion of Bitmap / JPEG / byte array on Android
Installation of Oracle Database XE on CentOS7 (t2.micro instance)