How can i get the build number of my android app?

This question already has an answer here:

  • How to get the build/version number of your Android application? 23 answers

  • 简单而简短的方式:实施到您的活动中

    String versionName = getApplicationContext().getPackageManager()
    .getPackageInfo(getApplicationContext().getPackageName(), 0).versionName;
    TextView tv=(TextView)findViewById(R.id.tv); 
    tv.setText(versionName);
    
    链接地址: http://www.djcxy.com/p/90750.html

    上一篇: 输出android versionname作为字符串

    下一篇: 我如何获得我的android应用程序的内部版本号?