我有这样的代码:
package lijap.app.starcraft2counters;
import java.io.File;
import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;
public class Settings extends Activity implements OnItemSelectedListener {
Spinner answertime;
Spinner gametime;
Spinner missesallowed;
String[] answerseconds = { "Unlimited", "1 second", "2 seconds", "3 seconds",
"4 seconds", " 5 seconds" };
String[] gameminutes = { "Unlimited", "1 minute", "2 minutes", "3 minutes",
"4 minutes", " 5 minutes" };
String[] numberofmisses = { "Unlimited", "5", "10", "15",
"20", "25" };
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Settings.this,
android.R.layout.simple_spinner_item, gameminutes);
answertime = (Spinner) findViewById(R.id.s_answertime);
answertime.setAdapter(adapter);
answertime.setOnItemSelectedListener(this);
}
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
}
我越来越糊涂试图把超过1个微调。 难道我共享阵列适配器,还是我为每一个新的? 怎么样onItemSelected? 正如你可以从我在上面串看到,我要三个纱厂。 我会怎么做呢?
我是新到Android,你可以告诉。 所有帮助appreciated- Lijap