Please, help.
Which is right?
Like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<android.support.v4.app.fragment
android:id="@+id/advertListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.myapp.fragment.AdvertListFragment"/>
Or like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<fragment
android:id="@+id/advertListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.myapp.fragment.AdvertListFragment"/>
Without prefix "android.support.v4".
P.s. I haven't more details
Use
<fragment
...
inflated in an activity that extends android.support.v4.app.FragmentActivity.
For further details, it's FragmentActivity.onCreateView() that handles the inflation for fragment elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With