دنبال کننده ها

۱۳۹۶ مهر ۱۰, دوشنبه

android - How to add a spinner in a fragment

[ad_1]



I'm trying to add a spinner in my fragment by using "double" instead of "String".



// Declaration
Spinner spinner;
double[] Array_note = 1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6;
ArrayAdapter<Double> adapter;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
// Inflate the layout for this fragment
final View view = inflater.inflate(R.layout.fragment_cofo, container,
false);

spinner = (Spinner)view.findViewById(R.id.Sp_F_Note);
adapter = new ArrayAdapter<Double>(getActivity(),android.R.layout.simple_spinner_item,Array_note);



It doesn't work and it says "it cannot be resolve constructor 'Arrayadopter(android.support.v4.app.FragmentActivity,int,double[])'



I hope someone can help me out :)




[ad_2]

لینک منبع