Creating A new Fragment
import android.support.v4.app.Fragment;
//...
public class ShowContacts extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.show_contact_frag, container, false);
//Main Code Written Here...
return view;
}
}