Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7729815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:04:00+00:00 2026-06-01T06:04:00+00:00

I have an android application that displays a toast every hour and then every

  • 0

I have an android application that displays a toast every hour and then every 2 hours I want a new screen to be displayed which I’m assuming is done by calling a new activity.

The timer im using is a chronometer and this is the code I have so far for it:

Chronometer.OnChronometerTickListener mChronoListener = new OnChronometerTickListener() { // listens to journey timer to initiate time based events
    int alertTime = 10000;
    int breakTime = 20000;

    public void onChronometerTick(Chronometer arg0) {

        long elapsedTime = SystemClock.elapsedRealtime() - arg0.getBase();

        if (elapsedTime > alertTime)
        {
            Toast.makeText(SafeDrive3Activity.this, "HOUR PASSED", Toast.LENGTH_LONG).show();
            alertTime += alertTime == 10000 ? 10000 : 10000;
        }
        if (elapsedTime > breakTime)
        {   
            //call activity2?
        }

    }
};  

Basically I want the new screen to display some text, a new timer andm a button so it will need to have a completely different design to the main activity.

I’m not sure what code to put in the if statement above to call a new activity or if thats a valid way of doing it.

With the new activity, do I need to create a new mail.xml file as well?

Any help with this would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:04:02+00:00Added an answer on June 1, 2026 at 6:04 am
    if (elapsedTime > breakTime)
    {   
         //call activity2?
        startActivity(new Intent(getApplicationContext(),NextActivityToLoad.class));
    }
    

    Use this an try…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with my android application. That application which uses the kSOAP
I have an android application that hits the WebView and displays the content. But
I have an android application that parses some HTML, downloads an image, and displays
I have an Android application that displays a list of names using checkboxes. I
I want to develop an android application, that displays live cricket scores as well
I am new to android and I have written a program that displays the
I currently have an Android application that displays a schedule for a ferry boat.
I have an Android application that connects to Facebook to request authorization of an
I have an Android application that uses the Android database to create tables and
I have an android application that requres a login based on users in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.