私はカスタムフォーム(xフィールドを表示)を作成する必要があります。プログラムでスピナーアンドロイドスタジオを塗る
Spinner[] listeCouleurs = new Spinner[nbEquipes];
listeCouleurs: is the name of the list
nbEquipes: is an int, (number of teams)
そして、私はリストに挿入する要素(listeCouleurs)がある: 私はスピナーリストオブジェクトを作成する方法があり
ArrayList<String> couleurs = new ArrayList<String>();
couleurs.add("Rouge");
couleurs.add("Bleu");
couleurs.add("Vert");
couleurs.add("Rose");
couleurs.add("Jaune");
そしてがあります私はxスピナーに要素を挿入する方法:
listeCouleurs[i] = new Spinner(this);
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,listeCouleurs[i], couleurs);
しかし、このエラーがあります:
Error:(94, 48) error: no suitable constructor found for ArrayAdapter(ConfigGame,Spinner,ArrayList) constructor ArrayAdapter.ArrayAdapter(Context,int,int) is not applicable (argument mismatch; Spinner cannot be converted to int) constructor ArrayAdapter.ArrayAdapter(Context,int,String[]) is not applicable (argument mismatch; Spinner cannot be converted to int) constructor ArrayAdapter.ArrayAdapter(Context,int,List) is not applicable (argument mismatch; Spinner cannot be converted to int)
この問題を解決するにはどうすればよいですか?
よろしく
エラーメッセージに答えが書かれています。これを解決するには、最も基本的な一般的なプログラミングの知識が必要です。あなたがSOに関する質問を始める前に、非常に基本的なことを学んでください。 –