Output android versionname as string
This question already has an answer here:
android:text="?android:attr/versionName"
Pleasae do not write markup/code etc you do not understand in first place. This is not going to do any magic just because you wrote it or deeply hope it to work even especially it makes no sense at all.
Data from Manifest can be obtained by using of PackageManager
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
PackageInfo structure holds both versionName
and versionCode
- See docs here.
上一篇: 检查应用程序是否在第一次运行