PickerUI icon indicating copy to clipboard operation
PickerUI copied to clipboard

cant show in fragment

Open aligurelli opened this issue 10 years ago • 4 comments

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?

aligurelli avatar Nov 13 '15 15:11 aligurelli

Hi,

did you by any chance found a solution for this?

Eyadoos avatar Jul 13 '16 09:07 Eyadoos

same probem here

mladenrakonjac avatar May 10 '17 13:05 mladenrakonjac

same problem

kushanshah11 avatar Sep 19 '17 08:09 kushanshah11

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 👍

jihadkahil avatar Oct 06 '17 08:10 jihadkahil