PagerActivity considered a static class, and you can access static methods and element data and objects in this way. About the code:
notTriedPasswordsList = PagerActivity.mainList;
Note: PagerActivity can now access the static mainList or notTriedPasswordsList (share the same memory). But this is the only object you can access as your code refers to static methods.
In the PagerActivity.viewPagerAdapter.refresh() code, I donβt understand what data is being updated, since I do not see enough code, refresh() again should be a static method. With the notifyDataSetChanged () code, notifyDataSetChanged must be a direct relationship between the viewPagerAdapter and the data object, possibly an ArrayList . Of course, I do not see a direct connection between them.
Perhaps you need code like:
viewPagerAdapter pagerAdapter = new viewPagerAdapter();
This way you can establish a connection between the adapter and possibly an ArrayList object. The advantage of creating an instance with a new one is that it saves data and state inside the class in the form of an object in my pagerAdapter example.
I could not offer a specific set of codes, since I do not see enough of it to fix it. Perhaps you can fix the code first, and then we can all contribute.
source share