-1

I want a fragment to appear from the right whenever I get an onListItemClick event, like a sliding menu. Suppose that I've implemented the fragment; how can i get it to appear? I can't seem to figure it out. Thank you for your time.

EDIT: this is the viewGroup where i want to add the fragment:

<TabHost
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal" />


            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp" />

            <android.support.v4.view.ViewPager
                android:id="@+id/tabviewpager"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="16dp"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginTop="16dp" >

            </android.support.v4.view.ViewPager>
    </LinearLayout>

</TabHost>

the TabViewPager is where I add my Fragments when the activity is instantiated,ans is where I need to add my new Fragment dynamically.

Libathos
  • 3,340
  • 5
  • 36
  • 61

2 Answers2

0

This is the library:

https://github.com/jfeinstein10/SlidingMenu

You can push the SlidingMenu from many ways, I think you need to try out first and back here when you stuck in an error, then I´ll be glad to help you.

Marckaraujo
  • 7,422
  • 11
  • 59
  • 97
  • yes..Maybe i wasn't clear.I don't want to use the SlidingMenu API I have created a Fragment with a certain ui and i want it to appear like the slidingmenu does (my fragment implementation not the slidingMenu).It's about adding a fragment to a layout but i can't seem to find how to add it correctly that's why i was asking – Libathos Jan 17 '13 at 19:51
  • If you want to appear like, Why don't you use SlidingMenu? – Marckaraujo Jan 17 '13 at 21:27
  • because this is just a menu I have a fragment with some textViews and other things,no need to switch to SlidingMenu i just need how to add it in my layout.IF you could help me with this i'd be grateful – Libathos Jan 18 '13 at 08:01
0

I'm fairly certain my question solves yours also, although slightly different layout:

Android fragment sidebar

Community
  • 1
  • 1
Anthony
  • 7,638
  • 3
  • 38
  • 71