-
Notifications
You must be signed in to change notification settings - Fork 0
Future Features?
Stuff to add in the future:
package com.example.android;
import android.content.Context; import android.preference.Preference; import android.util.AttributeSet;
public class VersionPreference extends Preference { public VersionPreference(Context context, AttributeSet attrs) { super(context, attrs); String versionName; final PackageManager packageManager = context.getPackageManager(); if (packageManager != null) { try { PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0); versionName = packageInfo.versionName; } catch (PackageManager.NameNotFoundException e) { versionName = null; } setSummary(versionName); } } }
Then in my preferences XML:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <com.example.android.VersionPreference android:title="Version" /> </PreferenceScreen>