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 7706899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:13:34+00:00 2026-06-01T00:13:34+00:00

I am working on an android project and I would like to create an

  • 0

I am working on an android project and I would like to create an application that intercept the inbound calls.How to assign a check box at contact list, in order to be able to select multiple contact persons once?

Here is my code:

//main activity

    public class MainActivity extends Activity {
        @Override
       public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        add = (Button)findViewById(R.id.add_reminder);
        manage =  (Button)findViewById(R.id.manage_reminders);
        add.setOnClickListener(this);
        manage.setOnClickListener(this);


    }
    public void onClick(View v) {
        switch(v.getId())
        {
        case R.id.manage_reminders:

            break;
        case R.id.add_reminder:
             Intent intent = new Intent(Intent.ACTION_PICK);
              intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
              startActivityForResult(intent, PICK_CONTACT);


            break;

        }


    }
     public void onActivityResult(int requestCode, int resultCode, Intent intent)
        {

          if (requestCode == PICK_CONTACT)
          {        
              Cursor cursor =  managedQuery(intent.getData(), null, null, null, null);
              cursor.moveToNext();
              String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
               String  name = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));

              Toast.makeText(this, "Contect LIST  =  "+name, Toast.LENGTH_LONG).show();
          }
        }//onActivityResult

}
  • 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-01T00:13:35+00:00Added an answer on June 1, 2026 at 12:13 am

    Take a look here: http://www.krvarma.com/2010/08/detecting-incoming-and-outgoing-calls-in-android/

    Just make an BroadcastReceiver that listens to:

    android.intent.action.PHONE_STATE
    

    If the phone state is ‘Ringing’, then there is an incoming call.

    TelephonyManager.EXTRA_STATE
    

    Like:

    public class IncomingCallReceiver extends BroadcastReceiver {
    
        @Override
        public void onReceive(Context context, Intent intent) {
                Bundle bundle = intent.getExtras();
    
                if(null == bundle)
                        return;
    
                String state = bundle.getString(TelephonyManager.EXTRA_STATE);
    
                if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING))
                {
                        String phonenumber = bundle.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
    
                        Log.i("IncomingCallReceiver","Incoming Number: " + phonenumber);
                }
        }
    }
    

    Now the phone number will be printed in logcat.

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

Sidebar

Related Questions

When I'm working on Android project I would like to use some magic shortcut
I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another
I'm working on an Android app in which I would like to use multi-touch.
I've got an Android project I'm working on that, ultimately, will require me to
I would like to dim-down my screen in my project as im working on.
I am working on an Android project with a few others that utilizes the
I'm currently working on a project that's based on Android. Without getting into many
Working on a project for caching. Would like to do it with file system
I am working on an Android app that utilizes the Google Maps API MapView,
I'm working on a client-server Android application and trying to figure out how to

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.