cant show in fragment
Hi,
if i use activity there is no problem to show pickerview. But when i use fragment the picker does not show.
Can you please fix this problem?
Hi,
did you by any chance found a solution for this?
same probem here
same problem
In your, Fragment Class create an interface and put your view inside the XML activity Class. like below: public class Fragment1 extends Fragment {
Button btn;
private Output output;
@Override
public void onAttach(Context context) {
super.onAttach(context);
output = (Output) context;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_layout, container, false);
btn = (Button) v.findViewById(R.id.button);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
output.onbtnClicked();
}
});
return v;
}
interface Output {
public void onbtnClicked();
}
}
in your class activity
public class activity implements Fragment1.Output{
@override(onbtnClicked(){
PickerView.slide(); } } It should work please for any information do not hesitate from contact me 👍 Good Luck 👍