简体   繁体   English

在Android中从后台恢复活动后如何检查用户是否在同一视图上

[英]How to check if user is on same view after resumes the activity from background to foreground in android

How to check if user is on same view after resumes the activity in android. 恢复android中的活动后如何检查用户是否在同一视图上。

Regards, AA. 关于AA。

If my understanding is correct about your question, 如果我对您的问题的理解正确,

The onResume override method will be called. 将调用onResume覆盖方法。

protected void onResume()
{
   super.onResume();
Log.d("MY_CLASS","User is here");
// User is still here.
}

if you want to check if the view is visible or not, You can do the following. 如果要检查视图是否可见,可以执行以下操作。

if(view.isVisible()
{

// Your code here.
}

Please Read the Activity LifeCycle HERE 请在此处阅读活动生命周期

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

相关问题 如何检查活动是在Android中的前景还是背景? - How to check whether activity is in foreground or background in android? 如何从服务检查活动是否在后台/前台运行? - How to check if an activity is running in background/foreground from a service? Android:如何防止在选择结果后从背景到前景再次调用选定的活动? - Android : How to prevent to call again selected activity again from background to foreground after the selection of the result? 如何检查活动是在前景中还是在可见背景中? - How to check if activity is in foreground or in visible background? Android:如何防止活动从后台开始并进入前台 - Android: how to prevent activity from starting in background and comming to foreground 如何检查活动是否为前台,并在活动为前台时将其带入后台? - How to check whether a activity is foreground and bring it to background when it is foreground? 如何将前台的Android活动置于后台 - How to put in foreground an Android activity that is in background 如何检查前台 Android 应用活动 - How to check foreground Android app activity 当活动从后台(暂停)到前台时,将重新创建Android Activity - Android Activity is recreated when activity from background(pause) to foreground 如何检查Android应用程序是在后台运行还是在前台运行? - How to check if an Android application is running in the background or in foreground?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM