i want to go to send my data to other activity(fragment) by using this code //activity1.class
Fragment fragment = null;
Bundle args = new Bundle();
args.putSerializable("content_news",oslist.get(position));
fragment = new Detail_News_fragment();
fragment.setArguments(args);
FragmentManager frgManager = getFragmentManager();
frgManager.beginTransaction().replace(R.id.content_frame, fragment)
.commit();
by retrieving data activity2
Intent i = getActivity().getIntent();
i.getSerializableExtra("ct_detail_eng");
HashMap<String, String> stud = ( HashMap<String, String> )
i.getSerializableExtra("content_news");
String Title = stud.get(News.TAG_TITLE_News);
Topic = (TextView)view.findViewById(R.id.TitleDetail);
Topic.setText(Title);
but it is not work at all please help, thx for advance
In your
Activity 1
put extra data in theIntent
which callsActivity 2
Then in
Activity 2
retrieve the intent usinggetIntent()
and the data usingIntent.getExtra()
Then you may want to put the retrieved data into your fragment in
Activity 2
.