Android: How can I get current opened application name on screen

前端 未结 6 1387
花落未央
花落未央 2020-11-28 15:00

Please suggest me how can I get current open application name, even if there is home screen on device then I will find \"Home screen is open\".

6条回答
  •  清歌不尽
    2020-11-28 15:44

    Simply using this code

    getActivity().getApplicationInfo().packageName
    

    It gives you application info, and then call the package name.

提交回复
热议问题