hello i have activity and i call many fragment based on my application business i need to call method from fragment in activity i searched in the internet but i cannot find the solution
this is my fragment :
public class HomeFragment extends Fragment implements View.OnClickListener {
public HomeFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
Log.d("onCreate", "onCreateViewHF");
view = inflater.inflate(R.layout.new_fragment_home, container, false);
}
/// this method i need to call in Activity
public void addUserLineInfoFragment() {
userLineInfoFragment = new UserLineInfoFragment();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.replace(R.id.user_info_fragment_container, userLineInfoFragment).commit();
Log.d("HOMMETEST","HOMMMME");
}