Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在构建一个应用程序,用户可以在其中动态添加editText,以便我可以将这些值发送到我的数据库中。我遇到的几乎所有网站都只添加视图,但它们不检索值。
在您使用以下方法设置标签edittext中添加视图时
LinearLayout linLayout = (LinearLayout)findViewWithTag("layout1");
此外,对于从 edittext 获取文本,您可以使用以下代码
EditText etText = (LinearLayout)findViewWithTag(“Tag1”); String text=etText.getText().ToString();