/** * 启动一个Activity,并且可以返回Result Code,通过代理Activity进行启动 * * @param className */ public boolean startActivityForResultByProxy(String className, int requestCode, Bundle bundle) { try { Intent intent = ProxyActionUtil.getInstance(getRealActivity()) .getStartActivityIntent(mProxyActivity, this, mDexPath, className, bundle); mProxyActivity.startActivityForResult(intent, requestCode); return true; } catch (Exception e) { return false; } }
@Override public void onClick(View v) { MenuObjectForListView currentMenuItem = menuObjectsList.get(position); Intent editItemIntent = new Intent(context, EditItem.class); editItemIntent.putExtra("menu_item_id", currentMenuItem.getMenuItemId()); int result = 1; FragmentActivity targetActivity = (FragmentActivity) context; targetActivity.startActivityForResult(editItemIntent, result); }