How to call a method in another activity

前端 未结 2 355
心在旅途
心在旅途 2020-12-18 06:32

I have a question about communication between activities on implementation program of Android.

Here is two activity classes.

public class HelloAndroi         


        
2条回答
  •  无人及你
    2020-12-18 06:50

    although you can do it by creating static method , but not right way because it will leave context . pass data to Tab1Activity you have in HelloAndroidActivity throgh intent . inside Tab1Activity getIntent and work accordingly .

    you can also use onTabChange() to reflect changes between tabs .

提交回复
热议问题