Adding Integers from Different Fragments in a ViewPager
问题 I have a MainActivity that has a ViewPager with 3 fragments ( FragA , FragB , FragC) In FragA, I declared an int a = 10; In FragB, I declared an int b = 20; In FragC, I have a TextView and a Button Now, all I want to do is that when I click the Button on the FragC, it will add the int a and int b from FragA and FragB and the sum will display on the TextView of the FragC Here's my current code: MainActivity.java public class MainActivity extends FragmentActivity { ViewPager viewPager = null;