Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
¿Cómo se supone que debo ir a cualquier fragmento de una actividad?

Este es el código de actividad. Estoy tratando de ir al fragmento cuando hago clic en un botón. Pero no sé cómo hacerlo. Y cuando uso la intent como el intent report de intención, me pide que declare el carrito de shopping_cart (fragmento) en el manifiesto.

 @Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { switch (item.getItemId()) { case (R.id.shopping_cart): case (R.id.report): Intent report; report = new Intent(getApplicationContext(), Report.class); startActivity(report); break; } return super.onOptionsItemSelected(item); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solo haz esto para ir de la actividad al fragmento

 public void replace(Fragment fragment) { FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.frame, fragment); fragmentTransaction.addToBackStack(fragment.toString()); fragmentTransaction.commit(); }

Y en el botón, haga clic en simplemente poner debajo del código

 replace(new FragmentName());
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!