Java Question FragmentStateAdapter issue hasstableids already exists

Biswajit

Active Member
Licensed User
Longtime User
I am creating a library for using viewpager2. For that, I'm extending FragmentStateAdapter to the Adapter class.
The library is compiling just fine but when I'm loading that library from B4A Libraries Manager, it's showing an error,
[IDE message - 2:13:54]
An error occurred.
Error parsing libraries.
com.biswajit.itemcarousel.ItemContainer.hasstableids already exists.

Can someone please check the code and let me know where is the issue?

Java Code:
Java:
public class ItemContainer extends FragmentStateAdapter {
    
    public ItemContainer(FragmentManager fragmentManager, Lifecycle lifecycle) {
        super(fragmentManager, lifecycle);
    }

    private List pages = new List();
    private boolean isInitialized = false;
    
    
    public void Initialize() {
      this.pages.Initialize();
      this.isInitialized = true;
    }
    
    public boolean getIsInitialized() {
      return this.isInitialized;
    }
    
    @Hide
    @Override
    public Fragment createFragment(int position) {
        View v = (View)this.pages.Get(position);
        return new CustomFragment(v);
    }

    @Override
    public int getItemCount() {
        return pages.getSize();
    }
  

    private class CustomFragment extends Fragment {
        private View _itemView;
        
        public CustomFragment(View itemView) {
            _itemView = itemView;
        }
        
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            return _itemView;
        }
    }
}
 

jahswant

Well-Known Member
Licensed User
Longtime User
In SLC add com.biswajit.itemcarousel.ItemContainer.hasstableids in ignore list. If that doesn't work, go and add @Hide in classes in that package. Always refresh after compiling.
 

Biswajit

Active Member
Licensed User
Longtime User
Top