@Override public void reInit() { initUserInfo(); unRemoveEt.setText(""); mListView.clearAll(); presenter.initCargoOrder(customerId); }
@Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { switch (event.getAction()) { case KeyEvent.ACTION_UP: // 键盘松开 presenter.loadDetailCargo(customerId, unRemoveEt.getText().toString()); unRemoveEt.requestFocus(); break; case KeyEvent.ACTION_DOWN: // 键盘按下 break; } return true; } return false; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_uncargo_order); initUserInfo(); unRemoveEt = (MaterialEditText) findViewById(R.id.load_et); unRemoveEt.setOnKeyListener(onKey); unRemoveBtn = (ButtonRectangle) findViewById(R.id.remove_btn); mListView = (MaterialListView) findViewById(R.id.material_listview); ((TextView) findViewById(R.id.tv_common_title)).setText(R.string.uncargo); Intent intent = getIntent(); customerId = intent.getStringExtra("customerId"); presenter = new UnCargoOrderPresenter(this); unRemoveBtn.setOnClickListener(new LoadButtonClick()); presenter.initCargoOrder(customerId); }