Posts

Showing posts from October, 2025

ViewPager2 with ListView example in Sketchware pro

Image
1. Create a new project in Sketchware. (Same codes for Android studio here  https://apktutor.in/2025/10/02/viewpager2-example-with-fragment-containing-a-listview/ ) 2. In main.xml add a TabLayout and a ViewPager viewpager1. 3. Convert ViewPager to  androidx.viewpager2.widget.ViewPager2 . 4. Switch On AppCompat and design. 5. Add three Custom Views fragment1, fragment2, and fragment3. In fragment1.xml add a TextView. In fragment2.xml add a MaterialButton materialbutton1. In fragment3.xml add a ListView listview1. 6. Add a Custom View for ListView items list_item_fruits.xml with two TextViews textview1 and textview2. 7. In Java/Kotlin manager, add a new Java file Fragment1.java . Add following codes in it. package com.my.newproject18; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; public c...