ListView not populated
<p>I have class that extends <code>FragmentActivity</code>, also I have a layout xml file that contains a <code>ListView</code> <strong>listview_layout.xml</strong></p>

<p></p>

<pre><code>&lt;LinearLayout
    android:layout_width="310dip"
    android:layout_height="fill_parent"
    android:background="#000000"
    android:orientation="vertical"
    android:paddingLeft="15dp"
    android:paddingRight="15dp" &gt;

    &lt;ListView
        android:id="@+id/menuList"
        android:layout_width="310dip"
        android:layout_height="wrap_content"
        android:background="#00FFFF"
        android:dividerHeight="2dip" /&gt;
&lt;/LinearLayout&gt;

&lt;FrameLayout
    android:id="@+id/overlay"
    android:layout_width="match_parent"
    android:layout_height="match_parent" &gt;
&lt;/FrameLayout&gt;
</code></pre>

<p></p>

<p>Note the id of the <code>ListView</code>, <strong>menuList</strong></p>

<p>From my java code, I grab this listview this way:</p>

<pre><code>private View getElementFromView(int layout, int element) {
        LayoutInflater inflater = LayoutInflater.from(this);
        View view = inflater.inflate(layout, null);
        return view.findViewById(element);
    }
</code></pre>

<p>This method will return a <code>View</code> to me, and I do a check in order to see if this <code>View</code> is an instance of <code>ListView</code></p>

<pre><code>    View v = getElementFromView(R.layout.listview_layout, R.id.menuList);
    if(v instanceof ListView) {
        Log.v("View: ", "This view is an instance of a ListView"); 
        ListView lv = (ListView)v; 
        String[] listItems = {"Item 1", "Item 2", "Item 3", "Item 4"}; 
        lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, listItems));
    }
</code></pre>

<p>As you can see, i want to set an <code>Adapter</code> to this <code>ListView</code>, this should populate the <code>ListView</code> with the text Item 1, Item 2 and so on..</p>

<p>What I dont understand is why the listview doesn't show up at all? I guess its since the <code>ListView</code> is not populated at all, but why isn't it populated? </p>

<p>Edit:</p>

<p>I should also mentioned that this project is marked as a Library. This is the interesting parts of<code>BaseWindow.java</code></p>

<pre><code>  public class BaseWindow extends SlidingFragmentActivity {
        public void InitializeWindow(Activity act, int layoutResourceId, int menuResourceId, String windowTitle)  {
                    super.setContentView(layoutResourceId); 
                    super.setBehindContentView(R.layout.menu_frame);  
                    this.menuResourceId = menuResourceId; 
                    this.act = act; 
                    initializeSlidingMenu();
                    setWindowTitle(windowTitle); 
         }

         public void initializeSlidingMenu()  {

            this.setSlidingActionBarEnabled(true);
            this.setSlidingActionBarEnabled(true);
            getSlidingMenu().setBehindOffsetRes(R.dimen.actionbar_home_width);
            getSlidingMenu().setShadowWidthRes(R.dimen.shadow_width);
            getSlidingMenu().setShadowDrawable(R.drawable.shadow);
            getSlidingMenu().setMenu(R.layout.listview_layout);
            getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
            getSlidingMenu().setBehindScrollScale(0.25f);

            View v = getElementFromView(R.layout.listview_layout, R.id.menuList);
            if(v instanceof ListView) {
                Log.v("View: ", "This view is an instance of a ListView"); 
                ListView lv = (ListView)v; 
                String[] listItems = {"Item 1", "Item 2", "Item 3", "Item 4"}; 
                lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, listItems));
                //lv.setAdapter(new MenuAdapter(this, menuResourceId));
            }       
        }
    }
</code></pre>

<p>This class is called from another project in my workspace, and yes I've included the class/project over as a Library:</p>

<pre><code>public class MainActivity extends BaseWindow {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.InitializeWindow(MainActivity.this, R.layout.activity_main, R.menu.slide_menu, "Home"); 

    }
}
</code></pre>

<p>Everything works quite well, but the listview is not populated at all. Hope this gives you an idea on what am trying to achieve. </p>
