setContentView and dynamically changing native android UI

I have been making an Android app and was wanting to add dynamic UI elements natively e.g. ListViews

This was not working at all, even though the code was correct. For example this code called in the onCreate on OFActivity would show no items in the list.

    ListView table = (ListView)findViewById(R.id.partsListView);
    ArrayAdapter<String> itemsAdapter =
            new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mobileArray);
    table.setAdapter(itemsAdapter);

And it turns out that anything done after the

ofActivity.setContentView(view);

in the initView() method of OFAndroid.java doesnt work .For example, updating the content of a listview with an adapter (as in the content is never updated on screen) or setting a click handler on a button programmatically (callback never called).

So I’ve commented ofActivity.setContentView(view) out in OFAndroid.java and called

setContentView(R.layout.main_layout);

At the top of the onCreate function in OFActivity. Obviously this is super hacky, is there a better workaround?

Cheers