Пример #1
0
        internal static int StartActivity(IApplicationThread whoThread, Intent intent, string type,
                                          Activity target, int requestCode)
        {
            var component = intent.getComponent();

            if (component == null)
            {
                return(IActivityManagerClass.START_CLASS_NOT_FOUND);
            }

            var info = package_manager.getActivityInfo(component, 0);

            if (info == null)
            {
                return(IActivityManagerClass.START_CLASS_NOT_FOUND);
            }

            ActivityThread thread = new ActivityThread();

            Activity activity = thread.startActivityNow(
                main_activity, null, intent, info, null, null, null);

            if (activity == null)
            {
                return(IActivityManagerClass.START_NOT_ACTIVITY);
            }

            ThreadPool.QueueUserWorkItem((state) => StartActivity(activity));

            return(IActivityManagerClass.START_SUCCESS);
        }
Пример #2
0
        static void Initialize()
        {
            main_form = new SWF.Form();
            main_form.FormBorderStyle = SWF.FormBorderStyle.FixedSingle;
            main_form.MaximizeBox     = false;
            main_form.MinimizeBox     = false;
            main_form.ClientSize      = device_config.Size;
            main_form.Name            = "XobotOS";
            main_form.Text            = "XobotOS";

            control = new XobotControl();

            system_thread = ActivityThread.systemMain();
            ContextImpl context = system_thread.getSystemContext();

            package_manager = (XobotPackageManager)context.getPackageManager();
        }