2 * Copyright (C) 2007-2011 OpenIntents.org
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package org.openintents.filemanager;
\r
19 import org.openintents.intents.AboutMiniIntents;
\r
20 import org.openintents.util.IntentUtils;
\r
21 import org.openintents.util.VersionUtils;
\r
23 import android.app.Activity;
\r
24 import android.content.Context;
\r
25 import android.content.Intent;
\r
30 * @version 2009-02-04
\r
34 public class AboutDialog extends DownloadAppDialog {
\r
35 private static final String TAG = "About";
\r
36 private static final boolean DEBUG_NO_OI_ABOUT = false;
\r
38 public AboutDialog(Context context) {
\r
40 R.string.oi_distribution_aboutapp_not_available,
\r
41 R.string.oi_distribution_aboutapp,
\r
42 R.string.oi_distribution_aboutapp_package,
\r
43 R.string.oi_distribution_aboutapp_website);
\r
45 String version = VersionUtils.getVersionNumber(mContext);
\r
46 String appname = VersionUtils.getApplicationName(mContext);
\r
47 String appnameversion = mContext.getString(R.string.oi_distribution_name_and_version, appname, version);
\r
49 StringBuilder sb = new StringBuilder();
\r
50 sb.append(appnameversion);
\r
52 sb.append(mMessageText);
\r
53 setMessage(sb.toString());
\r
56 public static void showDialogOrStartActivity(Activity activity, int dialogId) {
\r
57 Intent intent = new Intent(AboutMiniIntents.ACTION_SHOW_ABOUT_DIALOG);
\r
58 intent.putExtra(AboutMiniIntents.EXTRA_PACKAGE_NAME, activity.getPackageName());
\r
60 if (IntentUtils.isIntentAvailable(activity, intent)) {
\r
61 activity.startActivity(intent);
\r
63 activity.showDialog(dialogId);
\r