Skip to content
emanuelet edited this page Sep 15, 2014 · 3 revisions

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>

https://github.com/alexjlockwood/worker-fragments/blob/master/src/com/adp/retaintask/TaskFragment.java

https://github.com/Instagram/ig-json-parser

Clone this wiki locally