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

131
Views
Open activities from fragment with switch case

I am just learning programming and faced with such a problem. TI need to make a switch case with the opening of activities through a fragment, but I do not know what to write for the place ruki.setOnClickListener(new View.OnClickListener()

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_home, container, false);

        ImageButton ruki = v.findViewById(R.id.ruki);
        ImageButton nabor = v.findViewById(R.id.nabor);
        ruki.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (v.getId()){
                    case R.id.ruki:
                        Intent i = new Intent(getActivity(),ruki_activity.class);
                        startActivity(i);
                        break;
                    case R.id.nabor:
                        Intent o = new Intent(getActivity(),nabor_activity.class);
                        startActivity(o);
                        break;
                }

            }
        });
        
        return v;
    } 
about 4 years ago · Juan Pablo Isaza
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!