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

83
Views
Android Studio Progressbar

Could you please support me to set up properly progressbar, according to my existing code progressbar is not going during search process, it just showing me full bar when search will be finished.

int count = 0;
int forProgressbar = 0;

  button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            for (int i = 0; i < new content().text.length; i++) {

                Pattern pattern = Pattern.compile(editText.getText().toString());
                Matcher matcher = pattern.matcher(new content().text[i]);
                while (matcher.find()) {

                    count++;
                    forProgressbar = i;

                }

            }

            new Thread(() -> {

                hdlr.post(() -> progressBar.setProgress(forProgressbar));
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }).start();


            textView.setText("~" + editText.getText().toString() + "~" + count);
            count = 0;
        }


    });
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!