FileDocCategorySizeDatePackage
ShowActivity.javaAPI DocAndroid 1.5 API5088Wed May 06 22:41:08 BST 2009com.android.development

ShowActivity

public class ShowActivity extends android.app.Activity

Fields Summary
private android.content.pm.ActivityInfo
mActivityInfo
private android.widget.TextView
mPackage
private android.widget.ImageView
mIconImage
private android.widget.TextView
mClass
private android.widget.TextView
mLabel
private android.widget.TextView
mLaunch
private android.widget.TextView
mProcess
private android.widget.TextView
mTaskAffinity
private android.widget.TextView
mPermission
private android.widget.TextView
mMultiprocess
private android.widget.TextView
mClearOnBackground
private android.widget.TextView
mStateNotNeeded
Constructors Summary
Methods Summary
public voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.show_activity);

        mPackage = (TextView)findViewById(R.id.packageView);
        mIconImage = (ImageView)findViewById(R.id.icon);
        mClass = (TextView)findViewById(R.id.classView);
        mLabel = (TextView)findViewById(R.id.label);
        mLaunch = (TextView)findViewById(R.id.launch);
        mProcess = (TextView)findViewById(R.id.process);
        mTaskAffinity = (TextView)findViewById(R.id.taskAffinity);
        mPermission = (TextView)findViewById(R.id.permission);
        mMultiprocess = (TextView)findViewById(R.id.multiprocess);
        mClearOnBackground = (TextView)findViewById(R.id.clearOnBackground);
        mStateNotNeeded = (TextView)findViewById(R.id.stateNotNeeded);

        final PackageManager pm = getPackageManager();
        try {
            mActivityInfo = pm.getActivityInfo(ComponentName.unflattenFromString(
                getIntent().getData().getSchemeSpecificPart()), 0);
        } catch (PackageManager.NameNotFoundException e) {
        }
        if (mActivityInfo != null) {
            mPackage.setText(mActivityInfo.applicationInfo.packageName);
            mIconImage.setImageDrawable(mActivityInfo.loadIcon(pm));
            if (mActivityInfo.name.startsWith(
                    mActivityInfo.applicationInfo.packageName + ".")) {
                mClass.setText(mActivityInfo.name.substring(
                        mActivityInfo.applicationInfo.packageName.length()));
            } else {
                mClass.setText(mActivityInfo.name);
            }
            CharSequence label = mActivityInfo.loadLabel(pm);
            mLabel.setText("\"" + (label != null ? label : "") + "\"");
            switch (mActivityInfo.launchMode) {
            case ActivityInfo.LAUNCH_MULTIPLE:
                mLaunch.setText(getText(R.string.launch_multiple));
                break;
            case ActivityInfo.LAUNCH_SINGLE_TOP:
                mLaunch.setText(getText(R.string.launch_singleTop));
                break;
            case ActivityInfo.LAUNCH_SINGLE_TASK:
                mLaunch.setText(getText(R.string.launch_singleTask));
                break;
            case ActivityInfo.LAUNCH_SINGLE_INSTANCE:
                mLaunch.setText(getText(R.string.launch_singleInstance));
                break;
            default:
                mLaunch.setText(getText(R.string.launch_unknown));
            }
            mProcess.setText(mActivityInfo.processName);
            mTaskAffinity.setText(mActivityInfo.taskAffinity != null
                    ? mActivityInfo.taskAffinity : getText(R.string.none));
            mPermission.setText(mActivityInfo.permission != null
                    ? mActivityInfo.permission : getText(R.string.none));
            mMultiprocess.setText(
                    (mActivityInfo.flags&ActivityInfo.FLAG_MULTIPROCESS) != 0
                    ? getText(R.string.yes) : getText(R.string.no));
            mClearOnBackground.setText(
                    (mActivityInfo.flags&ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH) != 0
                    ? getText(R.string.yes) : getText(R.string.no));
            mStateNotNeeded.setText(
                    (mActivityInfo.flags&ActivityInfo.FLAG_STATE_NOT_NEEDED) != 0
                    ? getText(R.string.yes) : getText(R.string.no));
        }
    
public voidonResume()

        super.onResume();