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

  • Home
  • SEARCH
  • 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 8666751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:48:28+00:00 2026-06-12T17:48:28+00:00

I am developing an app which will show the service prvider (like Vodaphone etc)

  • 0

I am developing an app which will show the service prvider (like Vodaphone etc) information , of incoming call.
I accommplished it using the toast. with following code

      TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
                PhoneStateListener callStateListener = new PhoneStateListener() {
                public void onCallStateChanged(int state, String incomingNumber) 
                {
                        // TODO React to incoming call.

                        if(state==TelephonyManager.CALL_STATE_RINGING)
                        {
                                Toast.makeText(getApplicationContext(),finder.find(incomingNumber), Toast.LENGTH_LONG).show();

                        }

                }
                };
                telephonyManager.listen(callStateListener,PhoneStateListener.LISTEN_CALL_STATE);

the problem is Toast is visible for very little time. I want to make it visible till the user does not receive the call(i.e. till the phone is ringing, once recievd toast should disapper).

what should I do.

Can I use some other control like dialogbox etc.

thanks

  • 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-12T17:48:29+00:00Added an answer on June 12, 2026 at 5:48 pm

    run the toast in handler thread like following:

    onclick of call button try the following:

                Button call = (Button) findViewById(R.id.call);
        call.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                //call the user function to make call
    
            }
        });
    

    and add this method in your class:

            private final Runnable mRunnable = new Runnable() {
    
        public void run() {
                Toast.makeText(getApplicationContext(),finder.find(incomingNumber), Toast.LENGTH_LONG).show();
            mHandler.postDelayed(mRunnable, 1000);
        }
    
    };
    

    and cancel your toast onclick of end button or once the user picks the call:

               Button end= (Button) findViewById(R.id.end);
        end.setOnClickListener(new OnClickListener() {
    
            @Override
            public void onClick(View v) {
                //call the function to end the call if the other user dont receive
    
            }
        });
    

    otherwise use as like your function:

         if(state==TelephonyManager.CALL_STATE_RINGING)
                        {
                                mHandler.postDelayed(mRunnable, 1000);
    
                        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an app which will show some information in a detailview which
I am currently developing an app which will be on Android Market. How can
I'm developing a ASP.Net MVC3 app which will have few hundred videos. I want
I'm thinking about developing an iPhone/Android app which will include a server side. For
I am developing an app which listens to incoming sms. I have added the
I'm currently developing an app which will use a Linq to SQL (or possibly
Hi i am developing app in which there will be multiple tables in single
I am developing a app in which there is a button which will clear
I am developing an app which will used for trending tracker in twitter. The
I am developing in app where I am using an activity in which I'm

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.