所以当我的scanactivity
启动我的cardnumberbox
请求焦点时
从这里我扫描一些将被粘贴到cardnumberbox
然后的条形码
我的shelfnumberbox
请求焦点,然后我启动我的camactivity,我只是拍了一些照片,然后我回到我的扫描活动但是我的cardnumberbox
再次聚焦而不是shelfnumberbox
那么当我从我的camactivity启动扫描活动时,如何让我的shelfnumberbox获得焦点
//Scan activity
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
cardnumberbox.requestFocus();}
String k = getIntent().getStringExtra("cardid");
cardnumberbox.setText(k);
}
cardnumberbox.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
String text1 = cardnumberbox.getText().toString().trim();
if (text1.equals("R")) {
Toast.makeText(getApplicationContext(), getString(R.string.Skan_Udfyld_Kort_Nummer), Toast.LENGTH_SHORT).show();
cardnumberbox.setText("");
cardnumberbox.requestFocus();
} else if (cardnumberbox.getText().toString().length() > 0) {
shelfnumberbox.requestFocus();
}
{
}
}
//cam activity
public void btn_aprove2(View view) {
Intent i = new Intent(CameraActivity.this, ScanActivity.class);
String carde = cardnumberbox2.getText().toString().trim();
i.putExtra("cardid", carde);
startActivity(i);
}