Example usage for android.content Intent CATEGORY_LAUNCHER

List of usage examples for android.content Intent CATEGORY_LAUNCHER

Introduction

In this page you can find the example usage for android.content Intent CATEGORY_LAUNCHER.

Prototype

String CATEGORY_LAUNCHER

To view the source code for android.content Intent CATEGORY_LAUNCHER.

Click Source Link

Document

Should be displayed in the top-level launcher.

Usage

From source file:org.mariotaku.twidere.provider.TwidereDataProvider.java

private void displayMessagesNotification(final Context context, final ContentValues[] values) {
    final Resources res = context.getResources();
    final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
    final boolean display_screen_name = NAME_DISPLAY_OPTION_SCREEN_NAME
            .equals(mPreferences.getString(PREFERENCE_KEY_NAME_DISPLAY_OPTION, NAME_DISPLAY_OPTION_BOTH));
    final boolean display_hires_profile_image = res.getBoolean(R.bool.hires_profile_image);
    final Intent delete_intent = new Intent(BROADCAST_NOTIFICATION_CLEARED);
    final Bundle delete_extras = new Bundle();
    delete_extras.putInt(INTENT_KEY_NOTIFICATION_ID, NOTIFICATION_ID_DIRECT_MESSAGES);
    delete_intent.putExtras(delete_extras);
    final Intent content_intent;
    int notified_count = 0;
    for (final ContentValues value : values) {
        final String screen_name = value.getAsString(DirectMessages.SENDER_SCREEN_NAME);
        final ParcelableDirectMessage message = new ParcelableDirectMessage(value);
        mNewMessages.add(message);/*from w  w w  . j a v a  2 s  .com*/
        mNewMessageScreenNames.add(screen_name);
        mNewMessageAccounts.add(message.account_id);
        notified_count++;
    }
    Collections.sort(mNewMessages);
    final int messages_size = mNewMessages.size();
    if (notified_count == 0 || messages_size == 0 || mNewMessageScreenNames.size() == 0)
        return;
    final String title;
    if (messages_size > 1) {
        builder.setNumber(messages_size);
    }
    final int screen_names_size = mNewMessageScreenNames.size();
    final ParcelableDirectMessage message = mNewMessages.get(0);
    if (messages_size == 1) {
        final Uri.Builder uri_builder = new Uri.Builder();
        final long account_id = message.account_id;
        final long conversation_id = message.sender_id;
        uri_builder.scheme(SCHEME_TWIDERE);
        uri_builder.authority(AUTHORITY_DIRECT_MESSAGES_CONVERSATION);
        uri_builder.appendQueryParameter(QUERY_PARAM_ACCOUNT_ID, String.valueOf(account_id));
        uri_builder.appendQueryParameter(QUERY_PARAM_CONVERSATION_ID, String.valueOf(conversation_id));
        content_intent = new Intent(Intent.ACTION_VIEW, uri_builder.build());
    } else {
        content_intent = new Intent(context, HomeActivity.class);
        content_intent.setAction(Intent.ACTION_MAIN);
        content_intent.addCategory(Intent.CATEGORY_LAUNCHER);
        final Bundle content_extras = new Bundle();
        content_extras.putInt(INTENT_KEY_INITIAL_TAB, HomeActivity.TAB_POSITION_MESSAGES);
        content_intent.putExtras(content_extras);
    }
    if (screen_names_size > 1) {
        title = res.getString(R.string.notification_direct_message_multiple,
                display_screen_name ? "@" + message.sender_screen_name : message.sender_name,
                screen_names_size - 1);
    } else {
        title = res.getString(R.string.notification_direct_message,
                display_screen_name ? "@" + message.sender_screen_name : message.sender_name);
    }
    final String text_plain = message.text_plain;
    final String profile_image_url_string = message.sender_profile_image_url_string;
    final File profile_image_file = mProfileImageLoader.getCachedImageFile(
            display_hires_profile_image ? getBiggerTwitterProfileImage(profile_image_url_string)
                    : profile_image_url_string);
    final int w = res.getDimensionPixelSize(R.dimen.notification_large_icon_width);
    final int h = res.getDimensionPixelSize(R.dimen.notification_large_icon_height);
    final Bitmap profile_image = profile_image_file != null && profile_image_file.isFile()
            ? BitmapFactory.decodeFile(profile_image_file.getPath())
            : null;
    final Bitmap profile_image_fallback = BitmapFactory.decodeResource(res,
            R.drawable.ic_profile_image_default);
    builder.setLargeIcon(Bitmap
            .createScaledBitmap(profile_image != null ? profile_image : profile_image_fallback, w, h, true));
    buildNotification(builder, title, title, text_plain, R.drawable.ic_stat_direct_message, null,
            content_intent, delete_intent);
    final StringBuilder summary = new StringBuilder();
    final int accounts_count = mNewMessageAccounts.size();
    if (accounts_count > 0) {
        for (int i = 0; i < accounts_count; i++) {
            final String name = display_screen_name
                    ? "@" + getAccountScreenName(context, mNewMessageAccounts.get(i))
                    : getAccountName(context, mNewMessageAccounts.get(i));
            summary.append(name);
            if (i != accounts_count - 1) {
                summary.append(", ");
            }
        }
    }
    if (messages_size > 1) {
        final NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle(builder);
        final int max = Math.min(4, messages_size);
        for (int i = 0; i < max; i++) {
            final ParcelableDirectMessage s = mNewMessages.get(i);
            final String name = display_screen_name ? "@" + s.sender_screen_name : s.sender_name;
            style.addLine(Html.fromHtml("<b>" + name + "</b>: " + s.text_plain));
        }
        if (max == 4 && messages_size - max > 0) {
            style.addLine(context.getString(R.string.and_more, messages_size - max));
        }
        style.setSummaryText(summary);
        mNotificationManager.notify(NOTIFICATION_ID_DIRECT_MESSAGES, style.build());
    } else {
        final NotificationCompat.BigTextStyle style = new NotificationCompat.BigTextStyle(builder);
        style.bigText(message.text_plain);
        style.setSummaryText(summary);
        mNotificationManager.notify(NOTIFICATION_ID_DIRECT_MESSAGES, style.build());
    }
}

From source file:org.videolan.vlc.PlaybackService.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void showNotification() {
    try {//from   ww  w  .j a va 2  s  . co m
        MediaWrapper media = getCurrentMedia();
        if (media == null)
            return;
        Bitmap cover = AudioUtil.getCover(this, media, 64);
        String title = media.getTitle();
        String artist = Util.getMediaArtist(this, media);
        String album = Util.getMediaAlbum(this, media);
        Notification notification;

        if (media.isArtistUnknown() && media.isAlbumUnknown() && media.getNowPlaying() != null) {
            artist = media.getNowPlaying();
            album = "";
        }

        //Watch notification dismissed
        PendingIntent piStop = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_REMOTE_STOP),
                PendingIntent.FLAG_UPDATE_CURRENT);

        // add notification to status bar
        NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
                .setSmallIcon(R.drawable.ic_stat_vlc).setTicker(title + " - " + artist)
                .setAutoCancel(!MediaPlayer().isPlaying()).setOngoing(MediaPlayer().isPlaying())
                .setDeleteIntent(piStop);

        Intent notificationIntent = new Intent(this, MainActivity.class);
        notificationIntent.setAction(AudioPlayerContainerActivity.ACTION_SHOW_PLAYER);
        notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
        notificationIntent.putExtra(START_FROM_NOTIFICATION, true);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent,
                PendingIntent.FLAG_UPDATE_CURRENT);

        if (AndroidUtil.isJellyBeanOrLater()) {
            Intent iBackward = new Intent(ACTION_REMOTE_BACKWARD);
            Intent iPlay = new Intent(ACTION_REMOTE_PLAYPAUSE);
            Intent iForward = new Intent(ACTION_REMOTE_FORWARD);
            PendingIntent piBackward = PendingIntent.getBroadcast(this, 0, iBackward,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            PendingIntent piPlay = PendingIntent.getBroadcast(this, 0, iPlay,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            PendingIntent piForward = PendingIntent.getBroadcast(this, 0, iForward,
                    PendingIntent.FLAG_UPDATE_CURRENT);

            RemoteViews view = new RemoteViews(BuildConfig.APPLICATION_ID, R.layout.notification);
            view.setImageViewBitmap(R.id.cover,
                    cover == null ? BitmapFactory.decodeResource(getResources(), R.drawable.icon) : cover);
            view.setTextViewText(R.id.songName, title);
            view.setTextViewText(R.id.artist, artist);
            view.setImageViewResource(R.id.play_pause,
                    MediaPlayer().isPlaying() ? R.drawable.ic_pause_w : R.drawable.ic_play_w);
            view.setOnClickPendingIntent(R.id.play_pause, piPlay);
            view.setOnClickPendingIntent(R.id.forward, piForward);
            view.setOnClickPendingIntent(R.id.stop, piStop);
            view.setOnClickPendingIntent(R.id.content, pendingIntent);

            RemoteViews view_expanded = new RemoteViews(BuildConfig.APPLICATION_ID,
                    R.layout.notification_expanded);
            view_expanded.setImageViewBitmap(R.id.cover,
                    cover == null ? BitmapFactory.decodeResource(getResources(), R.drawable.icon) : cover);
            view_expanded.setTextViewText(R.id.songName, title);
            view_expanded.setTextViewText(R.id.artist, artist);
            view_expanded.setTextViewText(R.id.album, album);
            view_expanded.setImageViewResource(R.id.play_pause,
                    MediaPlayer().isPlaying() ? R.drawable.ic_pause_w : R.drawable.ic_play_w);
            view_expanded.setOnClickPendingIntent(R.id.backward, piBackward);
            view_expanded.setOnClickPendingIntent(R.id.play_pause, piPlay);
            view_expanded.setOnClickPendingIntent(R.id.forward, piForward);
            view_expanded.setOnClickPendingIntent(R.id.stop, piStop);
            view_expanded.setOnClickPendingIntent(R.id.content, pendingIntent);

            if (AndroidUtil.isLolliPopOrLater()) {
                //Hide stop button on pause, we swipe notification to stop
                view.setViewVisibility(R.id.stop, MediaPlayer().isPlaying() ? View.VISIBLE : View.INVISIBLE);
                view_expanded.setViewVisibility(R.id.stop,
                        MediaPlayer().isPlaying() ? View.VISIBLE : View.INVISIBLE);
                //Make notification appear on lockscreen
                builder.setVisibility(Notification.VISIBILITY_PUBLIC);
            }

            notification = builder.build();
            notification.contentView = view;
            notification.bigContentView = view_expanded;
        } else {
            builder.setLargeIcon(
                    cover == null ? BitmapFactory.decodeResource(getResources(), R.drawable.icon) : cover)
                    .setContentTitle(title)
                    .setContentText(
                            AndroidUtil.isJellyBeanOrLater() ? artist : Util.getMediaSubtitle(this, media))
                    .setContentInfo(album).setContentIntent(pendingIntent);
            notification = builder.build();
        }

        startService(new Intent(this, PlaybackService.class));
        if (!AndroidUtil.isLolliPopOrLater() || MediaPlayer().isPlaying())
            startForeground(3, notification);
        else {
            stopForeground(false);
            NotificationManagerCompat.from(this).notify(3, notification);
        }
    } catch (NoSuchMethodError e) {
        // Compat library is wrong on 3.2
        // http://code.google.com/p/android/issues/detail?id=36359
        // http://code.google.com/p/android/issues/detail?id=36502
    }
}

From source file:net.ustyugov.jtalk.service.JTalkService.java

@Override
public void onCreate() {
    configure();/*from ww  w . j  a  v  a 2  s  . c  om*/
    js = this;
    prefs = PreferenceManager.getDefaultSharedPreferences(this);
    iconPicker = new IconPicker(this);

    //        updateReceiver = new BroadcastReceiver() {
    //         @Override
    //         public void onReceive(Context arg0, Intent arg1) {
    //            updateWidget();
    //         }
    //        };
    //        registerReceiver(updateReceiver, new IntentFilter(Constants.UPDATE));

    connectionReceiver = new ChangeConnectionReceiver();
    registerReceiver(connectionReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));

    screenStateReceiver = new ScreenStateReceiver();
    registerReceiver(new ScreenStateReceiver(), new IntentFilter(Intent.ACTION_SCREEN_ON));
    registerReceiver(new ScreenStateReceiver(), new IntentFilter(Intent.ACTION_SCREEN_OFF));

    Intent i = new Intent(this, RosterActivity.class);
    i.setAction(Intent.ACTION_MAIN);
    i.addCategory(Intent.CATEGORY_LAUNCHER);
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, i, 0);

    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
    mBuilder.setSmallIcon(R.drawable.stat_offline);
    mBuilder.setContentTitle(getString(R.string.app_name));
    mBuilder.setContentIntent(contentIntent);

    startForeground(Notify.NOTIFICATION, mBuilder.build());

    WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    wifiLock = wifiManager.createWifiLock(WifiManager.WIFI_MODE_FULL, "jTalk");
    PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
    wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "jTalk");

    started = true;

    Cursor cursor = getContentResolver().query(JTalkProvider.ACCOUNT_URI, null,
            AccountDbHelper.ENABLED + " = '" + 1 + "'", null, null);
    if (cursor != null && cursor.getCount() > 0) {
        connect();
        cursor.close();
    }
}

From source file:org.jsharkey.grouphome.LauncherActivity.java

public void onClick(View v) {
    if (!(v.getTag() instanceof EntryInfo))
        return;/*from w ww .  j a  v  a2  s.com*/
    EntryInfo info = (EntryInfo) v.getTag();

    // build actual intent for launching app
    Intent launch = new Intent(Intent.ACTION_MAIN);
    launch.addCategory(Intent.CATEGORY_LAUNCHER);
    launch.setComponent(new ComponentName(info.resolveInfo.activityInfo.applicationInfo.packageName,
            info.resolveInfo.activityInfo.name));
    launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);

    try {
        this.startActivity(launch);
    } catch (Exception e) {
        Toast.makeText(this, "Problem trying to launch application", Toast.LENGTH_SHORT).show();
        Log.e(TAG, "Problem trying to launch application", e);
    }

}

From source file:com.yahala.android.NotificationsController.java

public static String getLauncherClassName(Context context) {
    try {//from  ww w .  j  a  v a2s .c  o m
        PackageManager pm = context.getPackageManager();

        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_LAUNCHER);

        List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0);
        for (ResolveInfo resolveInfo : resolveInfos) {
            String pkgName = resolveInfo.activityInfo.applicationInfo.packageName;
            if (pkgName.equalsIgnoreCase(context.getPackageName())) {
                return resolveInfo.activityInfo.name;
            }
        }
    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }
    return null;
}

From source file:com.b44t.messenger.NotificationsController.java

private static String getLauncherClassName(Context context) {
    try {//from   w ww .  ja  v a2s  . c om
        PackageManager pm = context.getPackageManager();

        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_LAUNCHER);

        List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0);
        for (ResolveInfo resolveInfo : resolveInfos) {
            String pkgName = resolveInfo.activityInfo.applicationInfo.packageName;
            if (pkgName.equalsIgnoreCase(context.getPackageName())) {
                return resolveInfo.activityInfo.name;
            }
        }
    } catch (Throwable e) {
        FileLog.e("messenger", e);
    }
    return null;
}

From source file:com.test.onesignal.MainOneSignalClassRunner.java

private static void AddLauncherIntentFilter() {
    Intent launchIntent = new Intent(Intent.ACTION_MAIN);
    launchIntent.setPackage("com.onesignal.example");
    launchIntent.addCategory(Intent.CATEGORY_LAUNCHER);
    ResolveInfo resolveInfo = new ResolveInfo();
    resolveInfo.activityInfo = new ActivityInfo();
    resolveInfo.activityInfo.packageName = "com.onesignal.example";
    resolveInfo.activityInfo.name = "MainActivity";

    RuntimeEnvironment.getRobolectricPackageManager().addResolveInfoForIntent(launchIntent, resolveInfo);
}

From source file:org.mariotaku.twidere.provider.TwidereDataProvider.java

private void onNewItemsInserted(final Uri uri, final ContentValues... values) {
    if (uri == null || values == null || values.length == 0)
        return;//from w w w  . j ava2  s .c o m
    if ("false".equals(uri.getQueryParameter(QUERY_PARAM_NOTIFY)))
        return;
    final Context context = getContext();
    final Resources res = context.getResources();
    final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
    switch (getTableId(uri)) {
    case TABLE_ID_STATUSES: {
        if (!mPreferences.getBoolean(PREFERENCE_KEY_NOTIFICATION_ENABLE_HOME_TIMELINE, false))
            return;
        final String message = res.getQuantityString(R.plurals.Ntweets, mNewStatusesCount, mNewStatusesCount);
        final Intent delete_intent = new Intent(BROADCAST_NOTIFICATION_CLEARED);
        final Bundle delete_extras = new Bundle();
        delete_extras.putInt(INTENT_KEY_NOTIFICATION_ID, NOTIFICATION_ID_HOME_TIMELINE);
        delete_intent.putExtras(delete_extras);
        final Intent content_intent = new Intent(context, HomeActivity.class);
        content_intent.setAction(Intent.ACTION_MAIN);
        content_intent.addCategory(Intent.CATEGORY_LAUNCHER);
        final Bundle content_extras = new Bundle();
        content_extras.putInt(INTENT_KEY_INITIAL_TAB, HomeActivity.TAB_POSITION_HOME);
        content_intent.putExtras(content_extras);
        builder.setOnlyAlertOnce(true);
        buildNotification(builder, res.getString(R.string.new_notifications), message, message,
                R.drawable.ic_stat_tweet, null, content_intent, delete_intent);
        mNotificationManager.notify(NOTIFICATION_ID_HOME_TIMELINE, builder.build());
        break;
    }
    case TABLE_ID_MENTIONS: {
        if (mPreferences.getBoolean(PREFERENCE_KEY_NOTIFICATION_ENABLE_MENTIONS, false)) {
            displayMentionsNotification(context, values);
        }
        break;
    }
    case TABLE_ID_DIRECT_MESSAGES_INBOX: {
        if (mPreferences.getBoolean(PREFERENCE_KEY_NOTIFICATION_ENABLE_DIRECT_MESSAGES, false)) {
            displayMessagesNotification(context, values);
        }
        break;
    }
    }
}

From source file:br.com.arlsoft.pushclient.PushClientModule.java

public static Intent getLauncherIntent(Bundle extras) {
    TiApplication appContext = TiApplication.getInstance();
    PackageManager pm = appContext.getPackageManager();
    Intent launch = pm.getLaunchIntentForPackage(appContext.getPackageName());

    launch.addCategory(Intent.CATEGORY_LAUNCHER);
    launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    if (extras != null && !extras.isEmpty()) {
        launch.putExtra(PROPERTY_EXTRAS, extras);
    }//  w  ww  .  j  a  v a2s  . c o m

    return launch;
}

From source file:org.uguess.android.sysinfo.ApplicationManager.java

void handleAction(final AppInfoHolder ai, int action) {
    Activity ctx = getActivity();// w  w w .  j a va2 s . com
    String pkgName = ai.appInfo.packageName;

    switch (action) {
    case ACTION_MENU:

        OnClickListener listener = new OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();

                // bypass the 'showMenu' action offset
                int action = which + 1;

                handleAction(ai, action);
            }
        };

        new AlertDialog.Builder(ctx).setTitle(R.string.actions)
                .setItems(new CharSequence[] { getString(R.string.manage), getString(R.string.run),
                        getString(R.string.search_market), getString(R.string.details) }, listener)
                .create().show();

        break;
    case ACTION_MANAGE:

        Intent it = new Intent(Intent.ACTION_VIEW);

        it.setClassName("com.android.settings", //$NON-NLS-1$
                "com.android.settings.InstalledAppDetails"); //$NON-NLS-1$
        it.putExtra("com.android.settings.ApplicationPkgName", pkgName); //$NON-NLS-1$
        // this is for Froyo
        it.putExtra("pkg", pkgName); //$NON-NLS-1$

        List<ResolveInfo> acts = ctx.getPackageManager().queryIntentActivities(it, 0);

        if (acts.size() > 0) {
            startActivity(it);
        } else {
            // for ginger bread
            it = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", //$NON-NLS-1$
                    Uri.fromParts("package", pkgName, null)); //$NON-NLS-1$

            acts = ctx.getPackageManager().queryIntentActivities(it, 0);

            if (acts.size() > 0) {
                startActivity(it);
            } else {
                Log.d(ApplicationManager.class.getName(), "Failed to resolve activity for InstalledAppDetails"); //$NON-NLS-1$
            }
        }

        break;
    case ACTION_LAUNCH:

        if (!pkgName.equals(ctx.getPackageName())) {
            it = new Intent("android.intent.action.MAIN"); //$NON-NLS-1$
            it.addCategory(Intent.CATEGORY_LAUNCHER);

            acts = ctx.getPackageManager().queryIntentActivities(it, 0);

            if (acts != null) {
                boolean started = false;

                for (int i = 0, size = acts.size(); i < size; i++) {
                    ResolveInfo ri = acts.get(i);

                    if (pkgName.equals(ri.activityInfo.packageName)) {
                        it.setClassName(ri.activityInfo.packageName, ri.activityInfo.name);

                        it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

                        try {
                            startActivity(it);

                            started = true;

                        } catch (Exception e) {
                            Log.e(ApplicationManager.class.getName(), "Cannot start activity: " + pkgName, //$NON-NLS-1$
                                    e);
                        }

                        break;
                    }
                }

                if (!started) {
                    Util.shortToast(ctx, R.string.run_failed);
                }
            }
        }

        break;
    case ACTION_SEARCH:

        it = new Intent(Intent.ACTION_VIEW);

        it.setData(Uri.parse("market://search?q=pname:" + pkgName)); //$NON-NLS-1$

        it = Intent.createChooser(it, null);

        startActivity(it);

        break;
    case ACTION_DETAILS:

        ApplicationInfo appInfo = ai.appInfo;

        String installDate;
        String fileSize;

        if (appInfo.sourceDir != null) {
            File f = new File(appInfo.sourceDir);
            installDate = DateUtils.formatDateTime(ctx, f.lastModified(),
                    DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_TIME);
            fileSize = Formatter.formatFileSize(ctx, f.length());
        } else {
            installDate = fileSize = getString(R.string.unknown);
        }

        StringBuffer sb = new StringBuffer().append("<small>") //$NON-NLS-1$
                .append(getString(R.string.pkg_name)).append(": ") //$NON-NLS-1$
                .append(appInfo.packageName).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.version_code)).append(": ") //$NON-NLS-1$
                .append(ai.versionCode).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.target_sdk)).append(": ") //$NON-NLS-1$
                .append(Util.getTargetSdkVersion(ctx, appInfo)).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.uid)).append(": ") //$NON-NLS-1$
                .append(appInfo.uid).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.file_size)).append(": ") //$NON-NLS-1$
                .append(fileSize).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.public_source)).append(": ") //$NON-NLS-1$
                .append(appInfo.publicSourceDir).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.source)).append(": ") //$NON-NLS-1$
                .append(appInfo.sourceDir).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.data)).append(": ") //$NON-NLS-1$
                .append(appInfo.dataDir).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.installed_date)).append(": ") //$NON-NLS-1$
                .append(installDate).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.process)).append(": ") //$NON-NLS-1$
                .append(appInfo.processName).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.app_class)).append(": ") //$NON-NLS-1$
                .append(appInfo.className == null ? "" //$NON-NLS-1$
                        : appInfo.className)
                .append("<br>") //$NON-NLS-1$
                .append(getString(R.string.task_affinity)).append(": ") //$NON-NLS-1$
                .append(appInfo.taskAffinity).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.permission)).append(": ") //$NON-NLS-1$
                .append(appInfo.permission == null ? "" //$NON-NLS-1$
                        : appInfo.permission)
                .append("<br>") //$NON-NLS-1$
                .append(getString(R.string.flags)).append(": ") //$NON-NLS-1$
                .append(appInfo.flags).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.enabled)).append(": ") //$NON-NLS-1$
                .append(appInfo.enabled).append("<br>") //$NON-NLS-1$
                .append(getString(R.string.manage_space_ac)).append(": ") //$NON-NLS-1$
                .append(appInfo.manageSpaceActivityName == null ? "" //$NON-NLS-1$
                        : appInfo.manageSpaceActivityName)
                .append("</small>"); //$NON-NLS-1$

        new AlertDialog.Builder(ctx).setTitle(ai.label == null ? appInfo.packageName : ai.label)
                .setNeutralButton(R.string.close, null).setMessage(Html.fromHtml(sb.toString())).create()
                .show();

        break;
    }
}