我正在制作一个程序,当您按下按钮时,会出现一个带有两个微调器的弹出窗口,但是当我尝试初始化这些微调器时遇到问题......并且不知道为什么。
我的弹出窗口:
public void añadirRegistro(View v){
showPopup(leer_registros.this);
}
private void showPopup(final Activity context) {
Spinner eleccionIP,eleccionRegistro;
borrar_datos BorrarDatos = new borrar_datos ();
// Inflate the popup_layout.xml
RelativeLayout viewGroup = (RelativeLayout) context.findViewById(R.id.popup);
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = layoutInflater.inflate(R.layout.popup_elegir_registros, viewGroup);
eleccionIP = (Spinner) layout.findViewById(R.id.popupIP);
eleccionRegistro = (Spinner)layout.findViewById(R.id.popupRegistro);
/*Cursor cur=BorrarDatos.obtenerIP();
BorrarDatos.rellenarSpinner(cur,eleccionIP);*/
final PopupWindow popup = new PopupWindow(context);
popup.setContentView(layout);
popup.setWidth(LayoutParams.WRAP_CONTENT);
popup.setHeight(LayoutParams.WRAP_CONTENT);
popup.setFocusable(true);
popup.showAtLocation(layout, Gravity.NO_GRAVITY, 200, 200);
ArrayAdapter <CharSequence> adapter = new ArrayAdapter <CharSequence> (context, android.R.layout.simple_spinner_item );
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
adapter.add("item 1");
adapter.add("item 2");
eleccionIP.setAdapter(adapter);
}
我得到的错误是按下微调器来查看我一直在给我的项目给我一个离开编译器的错误,而不是那个....