Right way to inflate android.support.v4.app.fragment from xml

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

Answers


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.


Need Your Help

How to make PHP code work without direct calls (on some kind of timer)?

php timer self

So... for example I want to add to 1 five every 5 minuts (1 is in the DB)... With out direct calls from users....

getpeername can not recognize connection established

android c

there's simple socket program (server / client) i made.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.