androidx.fragment.app.Fragment.onActivityCreated()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中androidx.fragment.app.Fragment.onActivityCreated()方法的一些代码示例,展示了Fragment.onActivityCreated()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.onActivityCreated()方法的具体详情如下:
包路径:androidx.fragment.app.Fragment
类名称:Fragment
方法名:onActivityCreated

Fragment.onActivityCreated介绍

暂无

代码示例

代码示例来源:origin: tyzlmjj/PagerBottomTabStrip

@Override
  public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mTvText.setText("A");
  }
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  Button demo = getView().findViewById(R.id.intro4);
  demo.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      startActivity(new Intent(getActivity().getBaseContext(), com.amqtech.opensource.appintroexample.ui.mainTabs.intro.CustomBackgroundIntro.class));
    }
  });
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  Button demo = getView().findViewById(R.id.intro2);
  demo.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      startActivity(new Intent(getActivity().getBaseContext(), PermissionsIntro2.class));
    }
  });
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  Button demo = getView().findViewById(R.id.intro1);
  demo.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      startActivity(new Intent(getActivity().getBaseContext(), PermissionsIntro1.class));
    }
  });
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  Button demo = getView().findViewById(R.id.intro1);
  demo.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      startActivity(new Intent(getActivity().getBaseContext(), DefaultIntro.class));
    }
  });
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  Button demo = getView().findViewById(R.id.intro3);
  demo.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      startActivity(new Intent(getActivity().getBaseContext(), com.amqtech.opensource.appintroexample.ui.mainTabs.intro.CustomLayoutIntro.class));
    }
  });
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  Button demo = getView().findViewById(R.id.intro2);
  demo.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
      startActivity(new Intent(getActivity().getBaseContext(), DefaultIntro2.class));
    }
  });
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings({"ConstantConditions", "deprecation"})
@Override
public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  adapter = new PermsPagerAdapter(getChildFragmentManager(), Titles, Numboftabs);
  pager = getView().findViewById(R.id.permPager);
  pager.setAdapter(adapter);
  tabs = getView().findViewById(R.id.permTabs);
  tabs.setBackgroundColor(Color.parseColor("#1976D2"));
  tabs.setDistributeEvenly(true);
  tabs.setCustomTabColorizer(new TabLayout.TabColorizer() {
    @Override
    public int getIndicatorColor(int position) {
      return Color.parseColor("#1976D2");
    }
  });
  tabs.setViewPager(pager);
}

代码示例来源:origin: AppIntro/AppIntro

@SuppressWarnings({"ConstantConditions", "deprecation"})
@Override
public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  adapter = new MainPagerAdapter(getChildFragmentManager(), Titles, Numboftabs);
  pager = getView().findViewById(R.id.mainPager);
  pager.setAdapter(adapter);
  tabs = getView().findViewById(R.id.mainTabs);
  tabs.setBackgroundColor(Color.parseColor("#1976D2"));
  tabs.setDistributeEvenly(false);
  tabs.setCustomTabColorizer(new TabLayout.TabColorizer() {
    @Override
    public int getIndicatorColor(int position) {
      return Color.parseColor("#1976D2");
    }
  });
  tabs.setViewPager(pager);
}

代码示例来源:origin: westnordost/StreetComplete

@Override public void onActivityCreated(@Nullable Bundle savedInstanceState)
  {
    super.onActivityCreated(savedInstanceState);
    if(savedInstanceState != null)
    {
      String stateName = savedInstanceState.getString("locationState");
      if(stateName != null) state = LocationState.valueOf(stateName);
      inProgress = savedInstanceState.getBoolean("inProgress");
    }
  }
}

代码示例来源:origin: offensive-security/nethunter-app

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  configFilePath = nh.APP_SD_FILES_PATH + "/configs/hostapd-karma.conf";
  super.onActivityCreated(savedInstanceState);
}

代码示例来源:origin: offensive-security/nethunter-app

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    configFilePath = nh.CHROOT_PATH + "/usr/share/mana-toolkit/run-mana/start-nat-simple-bdf-lollipop.sh";
  } else {
    configFilePath = nh.CHROOT_PATH + "/usr/share/mana-toolkit/run-mana/start-nat-simple-bdf-kitkat.sh";
  }
  super.onActivityCreated(savedInstanceState);
}

代码示例来源:origin: googlecast/CastVideos-android

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  setRetainInstance(true);
}

代码示例来源:origin: offensive-security/nethunter-app

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  // which chroot?
  checkforLegacyChroot();
  super.onActivityCreated(savedInstanceState);
}

代码示例来源:origin: hazems/mvvm-sample-app

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  final ProjectListViewModel viewModel = ViewModelProviders.of(this,
      viewModelFactory).get(ProjectListViewModel.class);
  observeViewModel(viewModel);
}

代码示例来源:origin: andstatus/andstatus

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  MyActivity activity = (MyActivity) getActivity();
  if (activity != null) {
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null) {
      actionBar.setTitle(R.string.manage_accounts);
    }
  }
}

代码示例来源:origin: andstatus/andstatus

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  final AccountSettingsActivity activity = (AccountSettingsActivity) getActivity();
  if (activity != null) {
    activity.restoreState(activity.getIntent(), "onActivityCreated");
  }
  super.onActivityCreated(savedInstanceState);
}

代码示例来源:origin: VictorAlbertos/RxActivityResult

@Override public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  getChildFragmentManager()
      .beginTransaction()
      .add(R.id.fl_fragment_container, new SampleFragmentNested())
      .commit();
}

代码示例来源:origin: hazems/mvvm-sample-app

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  final ProjectViewModel viewModel = ViewModelProviders.of(this, viewModelFactory)
      .get(ProjectViewModel.class);
  viewModel.setProjectID(getArguments().getString(KEY_PROJECT_ID));
  binding.setProjectViewModel(viewModel);
  binding.setIsLoading(true);
  observeViewModel(viewModel);
}

代码示例来源:origin: AlexMofer/ProjectX

@Override
public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  initializeFragment(getActivity(), savedInstanceState);
  if (isLocalBroadcastEnable() && getActivity() != null) {
    mLocalBroadcastManager = LocalBroadcastManager.getInstance(getActivity());
    IntentFilter filter = new IntentFilter();
    onAddLocalAction(filter);
    mLocalBroadcastManager.registerReceiver(mLocalBroadcastReceiver, filter);
    onRegisteredLocalBroadcastReceiver();
  }
}

相关文章