本文整理了Java中android.widget.Spinner.performClick()
方法的一些代码示例,展示了Spinner.performClick()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.performClick()
方法的具体详情如下:
包路径:android.widget.Spinner
类名称:Spinner
方法名:performClick
暂无
代码示例来源:origin: hidroh/materialistic
super.onBindViewHolder(holder);
final Spinner spinner = (Spinner) holder.findViewById(R.id.spinner);
holder.itemView.setOnClickListener(v -> spinner.performClick());
spinner.setAdapter(new SpinnerAdapter() {
@Override
代码示例来源:origin: ankidroid/Anki-Android
mNoteDeckSpinner.performClick();
mNoteTypeSpinner.performClick();
代码示例来源:origin: stackoverflow.com
final Spinner spinner = (Spinner) findViewById(R.id.spinner);
Button okButton = (Button) findViewById(R.id.yesButton);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(spinner.getSelectedItem() == null) { // user selected nothing...
spinner.performClick();
}
}
});
代码示例来源:origin: wasdennnoch/AndroidN-ify
@Override
public boolean onPreferenceClick(Preference preference) {
mSpinner.performClick();
return true;
}
});
代码示例来源:origin: dc297/mqttclpro
@Override
public void onClick(View v) {
messageComparatorSpinner.performClick();
}
});
代码示例来源:origin: mosamabinomar/AndroidEqualizer
@Override
public void onClick(View v) {
presetSpinner.performClick();
}
});
代码示例来源:origin: dc297/mqttclpro
@Override
public void onClick(View v) {
topicComparatorSpinner.performClick();
}
});
代码示例来源:origin: stackoverflow.com
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_spin_on_item );
Spinner sp= (Spinner) findViewById(R.id.spin);;
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.spinner_array , android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
sp.performClick();
}
代码示例来源:origin: stackoverflow.com
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
sp2.performClick();
代码示例来源:origin: stackoverflow.com
final Spinner spinner = (Spinner) findViewById(R.id.spinner);
Button okButton = (Button) findViewById(R.id.yesButton);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(spinner.getSelectedItem() == null) { // user selected nothing...
spinner.performClick();
}
}
});
代码示例来源:origin: stackoverflow.com
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_spin_on_item);
Spinner sp = (Spinner) findViewById(R.id.spin);
TextView tview1 = (TextView) findViewById(R.id.testtxt);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.spinner_array,
android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
sp.performClick();
}
public void onItemSelected(AdapterView<?> adapterView, View view, int i,
long l) {
String Name = (String) sp.getSelectedItem();
tview1.setText(Name);
}
代码示例来源:origin: stackoverflow.com
private void createDynamicSpinner() {
//Remove this line from top in your code and add here
Spinner spnOutHospitalList = new Spinner(Referance.this);
spnOutHospitalList.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
//Pass Spinner Object to this function to load data in it!
loadOutHospitalListSpinner(spnOutHospitalList);
spnOutHospitalList.performClick();
spnOutHospitalList.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,int position, long arg3) {
// TODO Auto-generated method stub
outHospitalName = hospitalNameListArray.get(position);
outHospital.setText(outHospitalName);
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
});
}
代码示例来源:origin: stackoverflow.com
timezoneEdit.setOnClickListener(new OnClickListener() {
public void onClick(View v)
{
Spinner timezonSpin = (Spinner) findViewById(R.id.timezoneSpin);//timezoneCall();
final ArrayList <String> timezonelist = new ArrayList<String>();
timezonelist.add("Gvatemala");
timezonelist.add("Gonduras");
timezonelist.add("Batumi");
timezonelist.add("Boston");
timezonelist.add("Zhytomir");
timezonelist.add("Zmerinka");
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(NewOrderActivity.this,
android.R.layout.simple_spinner_item, timezonelist);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
timezonSpin.setAdapter(dataAdapter);timezonSpin.performClick();
timezonSpin.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id)
{
Log.i("sd","Ya tut");
Log.i("choosed",timezonelist.get(position).toString());
timezoneEdit.setText(timezonelist.get(position));
}
public void onNothingSelected(AdapterView<?> arg0) {
TimeZone timezone = TimeZone.getDefault();
String TimeZoneName = timezone.getDisplayName();
int TimeZoneOffset = timezone.getRawOffset()/(60 * 60 * 1000);
Log.i("timezone",Integer.toString(TimeZoneOffset));
timezoneEdit.setText("UTC"+Integer.toString(TimeZoneOffset), TextView.BufferType.EDITABLE);
}
});
代码示例来源:origin: stackoverflow.com
public class YourActivity extends Activity {
private int curPos;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Spinner spinner = new Spinner(this);
String option[]={"By Date","By Transaction ID","By Customer Phone"};
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item,option);
spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item );
spinner.setAdapter(spinnerArrayAdapter);
spinner.performClick();
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentview, View v,int position, long id)
{
curPos = position;
Log.d("in select","yes");
}
@Override
public void onNothingSelected(AdapterView<?> arg0)
{
Toast.makeText(MainMenu.this,"no",Toast.LENGTH_LONG).show();
Log.d("In No select","No");
}
});
}
代码示例来源:origin: stackoverflow.com
public void onClick(View view) {
if (view == spinnerOne) {
spinnerOne.performClick();
spinnerTwo.performClick();
spinnerThree.performClick();
spinnerOne.performClick();
spinnerTwo.performClick();
spinnerThree.performClick();
spinnerOne.performClick();
spinnerTwo.performClick();
spinnerThree.performClick();
代码示例来源:origin: stackoverflow.com
public void onClick(View v)
sp.performClick();
代码示例来源:origin: stackoverflow.com
mSpinner.performClick();
代码示例来源:origin: stackoverflow.com
s.performClick();
代码示例来源:origin: stackoverflow.com
if(spinner1.getSelectedItem() == "india") {
spinner1.performClick();
if(spinner2.getSelectedItem() == "fury") {
spinner2.performClick();
代码示例来源:origin: stackoverflow.com
spinner.performClick();
内容来源于网络,如有侵权,请联系作者删除!