调用另外一个自定义的程序

代码:

Intent intent = new Intent();
            ComponentName componentName = new ComponentName(
                    “com.foreverlove.us”,
                    “com.foreverlove.us.Gallery”);

            Log.i(TAG, “mImageUrl=” + aImageUrlList.size());
            intent.putStringArrayListExtra(“ImageUrlList”, aImageUrlList);

            intent.putExtra(“documentID”, doucmentID);
            intent.putExtra(“CurrentPageNo”, CurrentPageNo);
            intent.setComponent(componentName);
            intent.setAction(“android.intent.action.MAIN”);

            try {
                startActivity(intent);
            } catch (Exception e) {
               Toast.makeText(getContext(), “找不到Gallery程序,请安装Gallery.apk”,
                        Toast.LENGTH_LONG).show();
            }