I am struggiling to implement a fragment UI with Ruboto. I had a perfectly working activity wich was creating its view in its onCreate method, and that is what I am trying to port to a fragment.
I end up with something like this:
In the activity onCreate() method I just build a placeholder for the fragment view;
#initial UI
setContentView(
frame_layout( :id => 100) do
text_view :text => "fragment place"
end
)
#fragment creation
ft = getFragmentManager().beginTransaction()
frag = MyFragment.new
ft.add( 100, frag )
ft.commit()
In the fragment onCreateView method, even returning a simple UI like this does not work
def onCreateView( inflater, container, savedInstanceState)
ruboto_import_widgets :TextView,
frag_view =
linear_layout(:orientation => :vertical) do
text_view :text => "fragment view"
end
return frag_view
end
But the fragment UI does not show, only the original UI is shown (no error in logcat either), what is wrong ?
Has someone successfully created a fragment UI with ruboto ?