I have to design an application for tablet. Due to the fact that space availability in that, I have decided to use fragment. Have to split the screen into four parts. Each part displays news title and description. When I click any one part from that 4 part, I have to get the corresponding fragment ID. How can I get it.
In my layout I have given frame layout, and added fragment dynamically using the fragment manager.
ralativLayout_Id.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ///Here I need to get the clicked part's fragment ID. Or have to find out which part clicked using any way. Toast.makeText(getActivity(), "Clicked " + news_title, Toast.LENGTH_SHORT).show(); ///Have to show the selected news in the whole screen need to call another activity for that. } });