[英]How can I add a row from within the application ? Android studio
hi guys i'm need your Help嗨,伙计们,我需要你们的帮助
I am doing a shopping app The user will enter the barcode and the program will enter the name and price of the product我正在做一个购物应用程序 用户将输入条形码,程序将输入产品的名称和价格
Here is a picture of the table这是一张桌子的照片
But I don't know exactly how to do that.但我不知道如何做到这一点。 I used the "TableLayout" And I added 14 "tableRow" and here is my code我使用了“TableLayout”并添加了 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"))
{
}
}
};
But I do not know what is the required action Can you help me?但我不知道需要什么操作你能帮我吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.