本文整理了Java中android.app.Instrumentation.invokeMenuActionSync()
方法的一些代码示例,展示了Instrumentation.invokeMenuActionSync()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instrumentation.invokeMenuActionSync()
方法的具体详情如下:
包路径:android.app.Instrumentation
类名称:Instrumentation
方法名:invokeMenuActionSync
暂无
代码示例来源:origin: android-hacker/VirtualXposed
@Override
public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) {
return base.invokeMenuActionSync(targetActivity, id, flag);
}
代码示例来源:origin: RobotiumTech/robotium
/**
* Clicks on an ActionBar item with a given resource id
*
* @param resourceId the R.id of the ActionBar item
*/
public void clickOnActionBarItem(int resourceId){
sleeper.sleep();
Activity activity = activityUtils.getCurrentActivity();
if(activity != null){
inst.invokeMenuActionSync(activity, resourceId, 0);
}
}
代码示例来源:origin: bzsome/VirtualApp-x326
@Override
public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) {
return base.invokeMenuActionSync(targetActivity, id, flag);
}
代码示例来源:origin: darkskygit/VirtualApp
@Override
public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) {
return base.invokeMenuActionSync(targetActivity, id, flag);
}
代码示例来源:origin: luili16/UIMocker
@Override
@CallSuper
public boolean invokeMenuActionSync(Activity targetActivity,
int id, int flag) {
if (DEBUG) {
Logger.d(TAG,"invokeMenuActionSync");
}
return mInstrumentation.invokeMenuActionSync(targetActivity, id, flag);
}
代码示例来源:origin: stackoverflow.com
} else {
instrumentation.invokeMenuActionSync(activity, ((MenuItem)item).getItemId(), 0);
代码示例来源:origin: com.jayway.android.robotium/robotium-solo
/**
* Clicks on an ActionBar item with a given resource id
*
* @param resourceId the R.id of the ActionBar item
*/
public void clickOnActionBarItem(int resourceId){
sleeper.sleep();
Activity activity = activityUtils.getCurrentActivity();
if(activity != null){
inst.invokeMenuActionSync(activity, resourceId, 0);
}
}
代码示例来源:origin: googlesamples/android-SwipeRefreshLayoutBasic
/**
* Test that selecting the refresh menu item triggers a refresh.
*/
public void testRefreshMenuItem() {
// When the refresh menu item is selected
getInstrumentation().invokeMenuActionSync(mTestActivity, R.id.menu_refresh, 0);
// Then the SwipeRefreshLayout should be refreshing
assertTrue(mSwipeRefreshLayout.isRefreshing());
}
代码示例来源:origin: googlesamples/android-SwipeRefreshListFragment
/**
* Test that selecting the refresh menu item triggers a refresh.
*/
public void testRefreshMenuItem() {
// When the refresh menu item is selected
getInstrumentation().invokeMenuActionSync(mTestActivity, R.id.menu_refresh, 0);
// Then the SwipeRefreshLayout should be refreshing
assertTrue(mSwipeRefreshLayout.isRefreshing());
}
代码示例来源:origin: andstatus/andstatus
clicked.set(InstrumentationRegistry.getInstrumentation().invokeMenuActionSync(mActivity, menuItemResourceId, 0));
if (clicked.get()) {
MyLog.i(this, method + "-Log instrumentation clicked");
内容来源于网络,如有侵权,请联系作者删除!