summaryrefslogtreecommitdiffstats
path: root/extensions_src
diff options
context:
space:
mode:
authorSara Ting <sarating@google.com>2012-08-08 17:21:03 -0700
committerSara Ting <sarating@google.com>2012-08-08 17:21:03 -0700
commita6ff5f0570e63e46a085bc82dc4256517e248f88 (patch)
tree7df63337d42e107ec724502ee0571e7b0493e16a /extensions_src
parent537f43d0eb9e86133ea8ed95862dfdbd788bba67 (diff)
downloadandroid_packages_apps_Calendar-a6ff5f0570e63e46a085bc82dc4256517e248f88.tar.gz
android_packages_apps_Calendar-a6ff5f0570e63e46a085bc82dc4256517e248f88.tar.bz2
android_packages_apps_Calendar-a6ff5f0570e63e46a085bc82dc4256517e248f88.zip
Move 'About Calendar' screen to extensions folder.
Change-Id: I8b3b4661dae584735c52667f8d253506fedf0b41
Diffstat (limited to 'extensions_src')
-rw-r--r--extensions_src/com/android/calendar/extensions/AboutPreferences.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/extensions_src/com/android/calendar/extensions/AboutPreferences.java b/extensions_src/com/android/calendar/extensions/AboutPreferences.java
new file mode 100644
index 00000000..43a15afa
--- /dev/null
+++ b/extensions_src/com/android/calendar/extensions/AboutPreferences.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.calendar.extensions;
+
+import android.app.Activity;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.os.Bundle;
+import android.preference.PreferenceFragment;
+
+import com.android.calendar.R;
+
+public class AboutPreferences extends PreferenceFragment {
+ private static final String BUILD_VERSION = "build_version";
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ addPreferencesFromResource(R.xml.about_preferences);
+
+ final Activity activity = getActivity();
+ try {
+ final PackageInfo packageInfo =
+ activity.getPackageManager().getPackageInfo(activity.getPackageName(), 0);
+ findPreference(BUILD_VERSION).setSummary(packageInfo.versionName);
+ } catch (NameNotFoundException e) {
+ findPreference(BUILD_VERSION).setSummary("?");
+ }
+ }
+} \ No newline at end of file