如何获得在Android上的应用程序的名称? [英] How to get the name of the application in android?

查看:205
本文介绍了如何获得在Android上的应用程序的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要得到我的应用程序的名称。我怎样才能得到呢?
先谢谢了。

I want to get the name of my application. How can i get that? Thanks in advance.

推荐答案

您可以使用软件包管理系统#getApplicationInfo()

you can use PackageManager#getApplicationInfo()

有关获取应用程序名称的设备中安装的所有软件包。
假设你有你的当前上下文对象CTX

For getting the Application Name for all packages installed in the device. Assuming you have your current Context object ctx

Resources appR = ctx.getResources();
CharSequence txt = appR.getText(appR.getIdentifier("app_name",
"string", ctx.getPackageName()));

这篇关于如何获得在Android上的应用程序的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆