Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8161181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:26:36+00:00 2026-06-06T18:26:36+00:00

I am trying to show a ListFragment. I think I have everything set up

  • 0

I am trying to show a ListFragment. I think I have everything set up correctly but no matter what I try I get a RuntimeException: Unable to start Activity. I have been searching and debugging for a few days now and havent came up with an answer yet. Here is the code I have so far. Any help will be greatly appreciated.

Here is the method that starts the Activity:

private void populateList(ArrayList<String> list) {
    Intent intent = new Intent(this, TipListActivity.class);
    intent.putStringArrayListExtra(INTENT_KEY, list);
    startActivity(intent);
}

Here is the Activity that the previous method starts:

public class TipListActivity extends FragmentActivity {

    /*************** FIELDS ***************************/

    ArrayList<String> arrayList;

    /*************** OVERRIDDEN METHODS ***************/

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tip_list_fragment_activity);

        Intent intent = getIntent();
        arrayList = intent.getStringArrayListExtra(TipActivity.INTENT_KEY);
    }
}

Here is tip_list_fragment_activity.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" >

    <fragment
        android:name=".TipListFragment"
        android:id="@+id/fragment_activity"
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />


</LinearLayout>

Here is TipListFragment:

public class TipListFragment extends ListFragment {
    @Override
    public void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ArrayAdapter<String> myListAdapter = new ArrayAdapter<String>(getActivity(),
            android.R.layout.simple_list_item_1, new TipListActivity().arrayList);

        setListAdapter(myListAdapter);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 
        savedInstanceState) {

    return inflater.inflate(R.layout.list_fragment, container, false);
    }
}

And finally here is list_fragment.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:paddingLeft="8dp"
     android:paddingRight="8dp">

 <ListView android:id="@+id/list"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:layout_weight="1"
           android:drawSelectorOnTop="false"/>

 <TextView android:id="@+id/textv"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:text="@string/app_name"/>
</LinearLayout>

Here is the stack trace:

07-01 00:41:37.932: E/AndroidRuntime(6083): FATAL EXCEPTION: main
07-01 00:41:37.932: E/AndroidRuntime(6083): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.tipcalculator/com.app.tipcalculator.TipListActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.ActivityThread.access$600(ActivityThread.java:123)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.os.Handler.dispatchMessage(Handler.java:99)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.os.Looper.loop(Looper.java:137)
07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.ActivityThread.main(ActivityThread.java:4424)

07-01 00:41:37.932: E/AndroidRuntime(6083): at java.lang.reflect.Method.invokeNative(Native Method)

07-01 00:41:37.932: E/AndroidRuntime(6083): at java.lang.reflect.Method.invoke(Method.java:511)

07-01 00:41:37.932: E/AndroidRuntime(6083): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

07-01 00:41:37.932: E/AndroidRuntime(6083): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

07-01 00:41:37.932: E/AndroidRuntime(6083): at dalvik.system.NativeStart.main(Native Method)

07-01 00:41:37.932: E/AndroidRuntime(6083): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)

07-01 00:41:37.932: E/AndroidRuntime(6083): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.Activity.setContentView(Activity.java:1835)

07-01 00:41:37.932: E/AndroidRuntime(6083): at com.app.tipcalculator.TipListActivity.onCreate(TipListActivity.java:28)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.Activity.performCreate(Activity.java:4465)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)

07-01 00:41:37.932: E/AndroidRuntime(6083): … 11 more
07-01 00:41:37.932: E/AndroidRuntime(6083): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment .TipListFragment: make sure class name exists, is public, and has an empty constructor that is public

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.support.v4.app.Fragment.instantiate(Fragment.java:391)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.support.v4.app.Fragment.instantiate(Fragment.java:359)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:262)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)

07-01 00:41:37.932: E/AndroidRuntime(6083): … 21 more
07-01 00:41:37.932: E/AndroidRuntime(6083): Caused by: java.lang.ClassNotFoundException: .TipListFragment

07-01 00:41:37.932: E/AndroidRuntime(6083): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)

07-01 00:41:37.932: E/AndroidRuntime(6083): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)

07-01 00:41:37.932: E/AndroidRuntime(6083): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)

07-01 00:41:37.932: E/AndroidRuntime(6083): at android.support.v4.app.Fragment.instantiate(Fragment.java:381)

07-01 00:41:37.932: E/AndroidRuntime(6083): … 24 more

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:26:37+00:00Added an answer on June 6, 2026 at 6:26 pm

    You aren’t using the correct id for your list. You have android:id="@+id/list".

    A ListFragment is looking for a very specific id.

    android:id="@android:id/list"
    

    Make that change and you should see an improvement in your app behavior.

    You might also move your code in the onCreate of TipListFragment to onActivityCreated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to show custom UILabel in UITableViewCell, but something wrong. My code: -
I am trying to show a alertdialog but i keep getting this error 01-24
Trying to show ProgressDialog, but getting: Can't create handler inside thread that has not
I am simply trying to show detail view page from table page I have
Im trying to show a datepicker inside a Modalbox . I tried almost everything.
I am trying to show a img in Base64 with Html.fromHtml I have a
I am working on android app and am trying to get fragments working but
Just trying to show grouped radio buttons on a page and get a selected
I'm trying to show a div AFTER all other animations have finished. The code
I'm trying show on views (each row) my custom form. It works, but the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.