How to pass Dynamic String data in to current tab fragment from Tab activity?

336 Views Asked by At

i am using below code, but that code use full for only static data pass, i need to pass string data dynamically from searchview. and set string with my code, below i am try code but code not working.

TabActivity

Bundle bundle=new Bundle();
bundle.putString("My_DATA",query); //here query is string variable. that in dynamic data.
mAdapter.getData(bundle);

TabPagerAdapter

        Fragment fragment = new ImageFragment();
        bundle.get("My_DATA");
        fragment.setArguments(bundle);
        return fragment;

TabFragment

if(getArguments()!=null){
String sentString = getArguments().getString("My_DATA");
Log.i("FRAGMENT MSG", sentString);}

Above code not working for dynamic data, but when Tab activity in change to query variable to any other string that time complete work this code, help me for that.

0

There are 0 best solutions below