Newer
Older
NemophilaClient / app / src / main / java / com / example / nemophila / PostActivity.java
package com.example.nemophila;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class PostActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_post);

        //評価を入力するためのプルダウン
        ArrayAdapter<String> rateAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item);
        rateAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

        rateAdapter.add("1");
        rateAdapter.add("2");
        rateAdapter.add("3");
        rateAdapter.add("4");
        rateAdapter.add("5");
        Spinner rateSpinner = (Spinner) findViewById(R.id.inputRate);
        rateSpinner.setAdapter(rateAdapter);



    }
}