PackageInfo LoadLabel slow performance

前端 未结 1 669
别跟我提以往
别跟我提以往 2021-01-13 10:17

I am coding an app for Android, where getting a label (actual name) of the application is extremelly slow. Particularly this code is performing really badly:



        
1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 10:44

    You could build a database in your app of "known" application names, and update it every time your app comes across a new package. The first run through will take a while, but after that you could save a lot of time by only checking one or two package names.

    0 讨论(0)
提交回复
热议问题