activity中访问内部fragment的函数

时间:2022-06-01 18:16:51

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {

if (resultCode == Activity.RESULT_OK) {
if (resultCode == Activity.RESULT_OK) {
FragmentManager fragmentManager = getSupportFragmentManager();
Home_SverListFragment ttFragment = (Home_SverListFragment) fragmentManager.findFragmentById(R.id.listView);
if (ttFragment == null)
Log.d("debug", "onActivityResult: Home_SverListFragment is null");

ttFragment.refreshSverListView(ServiceSearch.search());
return;
}
}

}