【发布时间】:2021-02-27 05:21:34
【问题描述】:
大家好,我需要你的帮助
我正在做一个购物应用 用户输入条形码,程序输入产品名称和价格
Here is a picture of the table
但我不知道该怎么做。 我使用了“表格布局” 我添加了 14 个“tableRow” 这是我的代码
code=findViewById(R.id.barcode);
code.addTextChangedListener(enter);
}
private TextWatcher enter = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(code.getText().toString().trim().equals("659245631")) {
//what can i write here to add row like this
// (coulmn0,coulmn1)
// ( price , product name)
}
}
@Override
public void afterTextChanged(Editable s) {
if(code.getText().toString().trim().equals("659245631"))
{
}
}
};
但我不知道需要采取什么措施你能帮帮我吗?
【问题讨论】:
-
我真的需要帮助:(
标签: java android android-studio if-statement tablelayout