有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java我的问题是关于安卓活动的意图

当我们通过intent进入安卓中的下一个活动时,下一个活动显示在屏幕上,上一个活动隐藏。当我们按下后退按钮时,它会返回到上一个活动。我的问题是,当我们从ist活动到另一个活动使用意图时,调用了哪个函数。是onPause()、onStop()还是任何其他plz答案


共 (2) 个答案

  1. # 1 楼答案

    在第一个活动中,当我们调用intent时,将调用OnPause()

    在第二个活动OnCreate()中->;OnStart()->;OnResume()将被调用

    注意 根据文档,第二个活动。onResume()应该在第一个活动之前调用。onStop()

    For Better Understanding please read Android lifecycle of Activity from developer/medium then go to Intent type 
    

    必须做的事

    For practice purpose create two activity and just override all method of
    activity life cycle with log n then call intent n check log.