简体   繁体   English

活动运行时是否有触发事件?

[英]Is there an event to fires when activity run?

在此处输入图像描述

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_test); do{ //actions //In this point the elements not shows }while(condicion); } } 
@Override protected void onStart() { super.onStart(); //In this point the elements not shows }

Is there an event to fires after elements appear?元素出现后是否有触发事件? (without invoke onPause() event) (不调用 onPause() 事件)

Is there an event to fires when activity starts?活动开始时是否有要触发的事件?

Yes, it is called onStart() as you see in the diagram you posted in your question.是的,正如您在问题中发布的图表中所见,它被称为onStart()

Is there an event to fires after elements appear?元素出现后是否有触发事件? (without invoke onPause() event) (不调用 onPause() 事件)

No, the elements in your event are available immediately after you call setContentView() in onCreate() so there is no need for an event.不,在onCreate()中调用setContentView()后,您的事件中的元素立即可用,因此不需要事件。

This sounds like you are trying to solve a problem that you think requires such an event.这听起来像是您正在尝试解决您认为需要此类事件的问题。 Please post a new question explaining what you want to do, including how the user interacts with your app and what you want to appear on the screen.请发布一个新问题,解释您想要做什么,包括用户如何与您的应用交互以及您希望在屏幕上显示什么。 We can point you to the correct way to accomplish this using the Android API.我们可以为您指出使用 Android API 完成此任务的正确方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM