小编Lig*_*gol的帖子

在与应用程序共享内容后获得异常IndexOutOfBoundsException FragmentManagerImpl

我在将内容分享到我的应用程序之后就得到了这个例外,就在应用程序已经启动的情况下.如果我直接启动应用程序,所有的工作都很好.如果我与我的应用程序分享内容并且应用程序尚未运行,则所有内容都能正常运行.它们不适用于第一种情况.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_real_debrid);

    LoginStore.init(getApplicationContext());
    AnalyticsManager.init(getApplicationContext());
    RDDownloadManager.init(this);
    ResponseHandlerManager.init(this);
    AppRater.app_launched(this, getString(R.string.app_name));
    layout = findViewById(R.id.drawer_layout);
    supportActionBar = getSupportActionBar();
    mTitle = mDrawerTitle = getTitle();
    setFragment(FragmentList.findFragmentById(0).getFragment(), false);
    if (layout instanceof DrawerLayout) {
        mDrawerLayout = (DrawerLayout) layout;
        mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
        supportActionBar.setDisplayHomeAsUpEnabled(true);
        supportActionBar.setHomeButtonEnabled(true);
        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
            public void onDrawerClosed(View view) {
                if (supportActionBar.getTitle().equals(mDrawerTitle))
                    supportActionBar.setTitle(mTitle);
                supportInvalidateOptionsMenu();
            }

            public void onDrawerOpened(View drawerView) {
                mTitle = supportActionBar.getTitle();
                supportActionBar.setTitle(mDrawerTitle);
                supportInvalidateOptionsMenu();
            }
        };
        mDrawerLayout.setDrawerListener(mDrawerToggle);

    } else {
        getSupportActionBar().setHomeButtonEnabled(false);
    }
    Credentials c …
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-sharing

8
推荐指数
1
解决办法
1192
查看次数