English 中文(简体)
背信弃义
原标题:Show Back Stack of Android

为了更好地了解安妮特德的行为,希望更多地了解背后的概念。 是否有办法列出所有活动,因为这些活动是在背后进行的。 这还应包括所有其他任务。

问题回答

我发现这一信息可在安乐施室(0.5.1)查阅:View->ToolWindows->Android。 然后,左边选定<>System Information。 Icon and from it sdown selected Graphics State. 这将提供大量信息,但如果你屈从于观点等级:你将看到目前的观点,即背信弃义。

禁止化学武器组织确实要求执行任务,相反,如果选择制图学国家选择活动管理员,那么你就会发现更多的信息(尽管我发现,比较简单地看到制图国的信息,以具体了解哪些活动处于背后阶段)。

您本人的背部,可使用以下密码来写自己的解决办法:

class MyApp : Application() {
   
   override fun onCreate() {
      super.onCreate()
      ActivityBackStackTracker.install(this)
   }
}

class ActivityBackStackTracker : Application.ActivityLifecycleCallbacks {

    override fun onActivityCreated(activity: Activity, bundle: Bundle?) {
        activityStack.add(activity::class)
    }

    override fun onActivityDestroyed(activity: Activity) {
        activityStack.remove(activity::class)
    }

    //..

    companion object {
        private val activityStack = mutableListOf<KClass<out Activity>>()

        fun getCurrentActivityStack() = listOf(activityStack)

        fun install(app: Application) {
            app.registerActivityLifecycleCallbacks(ActivityBackStackTracker())
        }
    }
}

之后,你可以随时随行:

Log.d(TAG, "${ActivityBackStackTracker.getCurrentActivityStack()})

这个问题已经与你相似。 我认为,这将回答你的问题:

任务活动要点

你们可以为此使用和播音室过滤器。 过滤器在上面点击记忆使用图表时,将显示所有活动情况,如停下来、脱节等生命周期的回击。

Profiler -> CPU usegraph -> See summary which will diplay current activity and callsback methods





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签