android.view.Window#performPanelIdentifierAction ( )源码实例Demo

下面列出了android.view.Window#performPanelIdentifierAction ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: AndroidComponentPlugin   文件: Instrumentation.java
/**
 * Execute a particular menu item.
 * 
 * @param targetActivity The activity in question.
 * @param id The identifier associated with the menu item.
 * @param flag Additional flags, if any.
 * @return Whether the invocation was successful (for example, it could be
 *         false if item is disabled).
 */
public boolean invokeMenuActionSync(Activity targetActivity, 
                                int id, int flag) {
    class MenuRunnable implements Runnable {
        private final Activity activity;
        private final int identifier;
        private final int flags;
        boolean returnValue;
        
        public MenuRunnable(Activity _activity, int _identifier,
                                int _flags) {
            activity = _activity;
            identifier = _identifier;
            flags = _flags;
        }
        
        public void run() {
            Window win = activity.getWindow();
            
            returnValue = win.performPanelIdentifierAction(
                        Window.FEATURE_OPTIONS_PANEL,
                        identifier, 
                        flags);                
        }
        
    }        
    MenuRunnable mr = new MenuRunnable(targetActivity, id, flag);
    runOnMainSync(mr);
    return mr.returnValue;
}
 
源代码2 项目: AndroidComponentPlugin   文件: Instrumentation.java
/**
 * Execute a particular menu item.
 * 
 * @param targetActivity The activity in question.
 * @param id The identifier associated with the menu item.
 * @param flag Additional flags, if any.
 * @return Whether the invocation was successful (for example, it could be
 *         false if item is disabled).
 */
public boolean invokeMenuActionSync(Activity targetActivity, 
                                int id, int flag) {
    class MenuRunnable implements Runnable {
        private final Activity activity;
        private final int identifier;
        private final int flags;
        boolean returnValue;
        
        public MenuRunnable(Activity _activity, int _identifier,
                                int _flags) {
            activity = _activity;
            identifier = _identifier;
            flags = _flags;
        }
        
        public void run() {
            Window win = activity.getWindow();
            
            returnValue = win.performPanelIdentifierAction(
                        Window.FEATURE_OPTIONS_PANEL,
                        identifier, 
                        flags);                
        }
        
    }        
    MenuRunnable mr = new MenuRunnable(targetActivity, id, flag);
    runOnMainSync(mr);
    return mr.returnValue;
}
 
源代码3 项目: AndroidComponentPlugin   文件: Instrumentation.java
/**
 * Execute a particular menu item.
 * 
 * @param targetActivity The activity in question.
 * @param id The identifier associated with the menu item.
 * @param flag Additional flags, if any.
 * @return Whether the invocation was successful (for example, it could be
 *         false if item is disabled).
 */
public boolean invokeMenuActionSync(Activity targetActivity, 
                                int id, int flag) {
    class MenuRunnable implements Runnable {
        private final Activity activity;
        private final int identifier;
        private final int flags;
        boolean returnValue;
        
        public MenuRunnable(Activity _activity, int _identifier,
                                int _flags) {
            activity = _activity;
            identifier = _identifier;
            flags = _flags;
        }
        
        public void run() {
            Window win = activity.getWindow();
            
            returnValue = win.performPanelIdentifierAction(
                        Window.FEATURE_OPTIONS_PANEL,
                        identifier, 
                        flags);                
        }
        
    }        
    MenuRunnable mr = new MenuRunnable(targetActivity, id, flag);
    runOnMainSync(mr);
    return mr.returnValue;
}
 
源代码4 项目: AndroidComponentPlugin   文件: Instrumentation.java
/**
 * Execute a particular menu item.
 * 
 * @param targetActivity The activity in question.
 * @param id The identifier associated with the menu item.
 * @param flag Additional flags, if any.
 * @return Whether the invocation was successful (for example, it could be
 *         false if item is disabled).
 */
public boolean invokeMenuActionSync(Activity targetActivity, 
                                int id, int flag) {
    class MenuRunnable implements Runnable {
        private final Activity activity;
        private final int identifier;
        private final int flags;
        boolean returnValue;
        
        public MenuRunnable(Activity _activity, int _identifier,
                                int _flags) {
            activity = _activity;
            identifier = _identifier;
            flags = _flags;
        }
        
        public void run() {
            Window win = activity.getWindow();
            
            returnValue = win.performPanelIdentifierAction(
                        Window.FEATURE_OPTIONS_PANEL,
                        identifier, 
                        flags);                
        }
        
    }        
    MenuRunnable mr = new MenuRunnable(targetActivity, id, flag);
    runOnMainSync(mr);
    return mr.returnValue;
}
 
源代码5 项目: android_9.0.0_r45   文件: Instrumentation.java
/**
 * Execute a particular menu item.
 * 
 * @param targetActivity The activity in question.
 * @param id The identifier associated with the menu item.
 * @param flag Additional flags, if any.
 * @return Whether the invocation was successful (for example, it could be
 *         false if item is disabled).
 */
public boolean invokeMenuActionSync(Activity targetActivity, 
                                int id, int flag) {
    class MenuRunnable implements Runnable {
        private final Activity activity;
        private final int identifier;
        private final int flags;
        boolean returnValue;
        
        public MenuRunnable(Activity _activity, int _identifier,
                                int _flags) {
            activity = _activity;
            identifier = _identifier;
            flags = _flags;
        }
        
        public void run() {
            Window win = activity.getWindow();
            
            returnValue = win.performPanelIdentifierAction(
                        Window.FEATURE_OPTIONS_PANEL,
                        identifier, 
                        flags);                
        }
        
    }        
    MenuRunnable mr = new MenuRunnable(targetActivity, id, flag);
    runOnMainSync(mr);
    return mr.returnValue;
}
 
源代码6 项目: droidel   文件: Instrumentation.java
/**
 * Execute a particular menu item.
 * 
 * @param targetActivity The activity in question.
 * @param id The identifier associated with the menu item.
 * @param flag Additional flags, if any.
 * @return Whether the invocation was successful (for example, it could be
 *         false if item is disabled).
 */
public boolean invokeMenuActionSync(Activity targetActivity, 
                                int id, int flag) {
    class MenuRunnable implements Runnable {
        private final Activity activity;
        private final int identifier;
        private final int flags;
        boolean returnValue;
        
        public MenuRunnable(Activity _activity, int _identifier,
                                int _flags) {
            activity = _activity;
            identifier = _identifier;
            flags = _flags;
        }
        
        public void run() {
            Window win = activity.getWindow();
            
            returnValue = win.performPanelIdentifierAction(
                        Window.FEATURE_OPTIONS_PANEL,
                        identifier, 
                        flags);                
        }
        
    }        
    MenuRunnable mr = new MenuRunnable(targetActivity, id, flag);
    runOnMainSync(mr);
    return mr.returnValue;
}