Android:获取mainfest信息

1.获取versionName,versionCode

        try {
            String version = this.getPackageManager().getPackageInfo(getPackageName(),0).versionName;
            int versionCode = this.getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
        } catch (NameNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

 

posted @ 2013-05-03 13:50  暗殇  阅读(185)  评论(0编辑  收藏  举报