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 8378259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:53:22+00:00 2026-06-09T15:53:22+00:00

short info about project: minSDK = 8 import android.support.v4 Part of class code: public

  • 0

short info about project:

  • minSDK = 8
  • import android.support.v4

Part of class code:

public class DetailsActivity extends FragmentActivity implements ToplineTrigger {

static Context mContext;

private static FragmentManager fm;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.details);
    if (mContext == null)
        mContext = Pleazzme.getAppContext();

    DetailsTitleFragment title = new DetailsTitleFragment();
    DocumentDescriptionWeb description = new DocumentDescriptionWeb();
    getSupportFragmentManager()
            .beginTransaction()
            .add(R.id.detailstitlefragment_wrap, title, "DetailsTitle")
            .add(R.id.documentdescriptionweb_wrap, description, "WebDescription")
            .commit();

    ((Topline) fm.findFragmentByTag("Topline")).setDetailsMode();
};

Xml view:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/details_contentwrapper"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >

<fragment
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    class="com.mtechnologia.pleazzme.Topline"
    android:tag="Topline" />

<FrameLayout
    android:id="@+id/detailstitlefragment_wrap"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
</FrameLayout>

<FrameLayout
    android:id="@+id/documentdescriptionweb_wrap"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
</FrameLayout>
</LinearLayout>

classes declaration:

public class DetailsTitleFragment extends ListFragment{...}

public class DocumentDescriptionWeb extends Fragment {

WebView mWebView = null;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    return inflater.inflate(R.layout.simplewebview, container);
}

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mWebView = (WebView) view.findViewById(R.id.simplewebview);
    mWebView.getSettings().setJavaScriptEnabled(false);
    mWebView.getSettings().setSupportZoom(false);

    String data = "asdasdasd";
    mWebView.loadData(data, "text/html", "utf-8");
}

}  

after code runs i get error:

08-15 19:11:08.003: E/AndroidRuntime(24708): FATAL EXCEPTION: main
08-15 19:11:08.003: E/AndroidRuntime(24708): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mtechnologia.pleazzme/com.mtechnologia.pleazzme.DetailsActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.ActivityThread.access$600(ActivityThread.java:127)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.os.Looper.loop(Looper.java:137)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.ActivityThread.main(ActivityThread.java:4511)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at java.lang.reflect.Method.invokeNative(Native Method)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at java.lang.reflect.Method.invoke(Method.java:511)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at dalvik.system.NativeStart.main(Native Method)
08-15 19:11:08.003: E/AndroidRuntime(24708): Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.view.ViewGroup.addViewInner(ViewGroup.java:3342)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.view.ViewGroup.addView(ViewGroup.java:3213)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.view.ViewGroup.addView(ViewGroup.java:3170)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.view.ViewGroup.addView(ViewGroup.java:3150)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.support.v4.app.NoSaveStateFrameLayout.wrap(NoSaveStateFrameLayout.java:40)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1083)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:635)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1431)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:523)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1136)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.Activity.performStart(Activity.java:4480)
08-15 19:11:08.003: E/AndroidRuntime(24708):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1940)
08-15 19:11:08.003: E/AndroidRuntime(24708):    ... 11 more  

can someone tell me, what i doing wrong?
i know, that i can declare both fragments in XML, but i need add this fragments programmatically, to replace them when i need this.
Thanks in advance for your help

  • 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-09T15:53:24+00:00Added an answer on June 9, 2026 at 3:53 pm

    You need to change

    inflater.inflate(R.layout.simplewebview, container);
    

    to

    inflater.inflate(R.layout.simplewebview, container, false);
    

    Setting that attribute to false will ensure that the view is detatched from the parent container that’s passed in from the view. The View that’s returned from onCreateView() can’t be attached to a parent since it will be added to the container shortly after by the system itself.

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

Sidebar

Related Questions

Ineed to play a short MP4 video on my android app I'm searching info
Ineed to play a short MP4 video on my android app I'm searching info
Short and simple, our project has a Launcher component and an Application component and
I've been using the LongURL.org API for expanding short URLs. The great thing about
For a project I'm working I need to have some sort of enumaration class
When using powershell to retrieve info about events Message column gets trimmed and is
I have struct that store info about ARP packet and I need to save
This post is about C# and .Net, but some info is valuable for other
Short version: $count in the code below seems to be 0 even when it
I am about to join a new software team midway through a project. They

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.