大家好。
我需要验证字符串的内容是否为空。如果字符串是 != null 我在 imageButton 中创建一个 performClick。此单击使另一个布局中的布局膨胀。然后我需要在膨胀的editText中写入文本,但我不能。不可能同时膨胀并在 editText 中写入文本。
这是我的代码
if(sApelido != ""){
inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
b = (LinearLayout)inflater.inflate(R.layout.socio_form_structured_name,null);
lLayout = (LinearLayout)findViewById(R.id.main_layout_id7);
lLayout = (LinearLayout)findViewById(R.layout.socio_form_structured_name);
lLayout.addView(b);
apelido.setText(null); //Write in one of the editText's that was inflated
apelido.setText(sApelido); //apelido is a editText that belongs to LinearLayout b
}
我不知道你是否理解我的问题谢谢你的帮助。