android - Want to do Two diffrent activity in same screen -
i want 2 different activity in same screen . know fragment when use fragment show different ui 10 inch table , different 4.6 inch mobile. want screen open dividing screen in 2 equal part in landscape mode , can able different activity in both equally divided part of screen. searched lot didn't find appropriate solution question.
actually want develop game in 1 half of screen user , half computer(android os).
dividing in equal parts can achieved weight attribute.
i assuming versed fragments telling xml part screen divided 2 equal fragments.
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <fragment android:name="com.example.android.fragments.fragment1" android:id="@+id/headlines_fragment" android:layout_weight="1" android:layout_width="match_parent" android:layout_height="0dp" /> <fragment android:name="com.example.android.fragments.articlefragment" android:id="@+id/article_fragment" android:layout_weight="1" android:layout_width="match_parent" android:layout_height="0dp" />
this divide screen 2 parts , different ui in different fragments.
you can inflate single xml file multiple fragment classes hence achieving same ui
Comments
Post a Comment