0

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.

Ravi Vaghela
  • 3,420
  • 2
  • 23
  • 51
  • You may getting data when onCreate calls, try to fetch it with onTabChange, or use activity variable for that dynamic data, which can be access on its fragments. – Abdul Wahab Sep 18 '15 at 07:38
  • but not need to get data at onTabChange, when i submit any string in searchview at a time pass data in current fragment, – Ravi Vaghela Sep 18 '15 at 07:41

0 Answers0