-1

adding this to my layout returns an empty layout after I inflate it and add it to another view

  <View 
  android:layout_width="fill_parent"
  android:layout_height="1px" 
  android:background="#e0e0e0"/>

here's how I inflate it

LayoutInflater vi = (LayoutInflater)getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                View v = vi.inflate(R.layout.stoplistitem, null);
if(dt != null && stop.getDescription() != null)
    dt.setText(stop.getDescription());
if(st != null && stop.getStreet() != null)
    st.setText(stop.getStreet());
if(mt != null && stop.getMunicipal() != null)
    mt.setText(stop.getMunicipal());
if(idt != null && stop.getId() != null){
    idt.setText(stop.getId().toString());

//edit I can see the view, but there is no content

Mars
  • 4,197
  • 11
  • 39
  • 63

1 Answers1

0

Attach this view to a ViewGroup while inflating by using inflate(int resource, ViewGroup root, boolean attachToRoot) and attachToRoot = true, root is the component on which you want to inflate

Neeraj Nama
  • 1,562
  • 1
  • 18
  • 24