show ver in toolbar
This commit is contained in:
parent
15d64ce4eb
commit
f8301360dc
|
@ -23,8 +23,8 @@ android {
|
|||
applicationId "info.nightscout.androidaps"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 23
|
||||
versionCode 1003
|
||||
versionName "1.0.03"
|
||||
versionCode 1004
|
||||
versionName "1.0.04"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.view.ViewPager;
|
||||
|
@ -57,6 +58,12 @@ public class MainActivity extends AppCompatActivity {
|
|||
if (Config.logFunctionCalls)
|
||||
log.debug("onCreate");
|
||||
|
||||
// show version in toolbar
|
||||
try {
|
||||
setTitle(getString(R.string.app_name) + " v" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
|
|
Loading…
Reference in a new issue