Get call log of a particular number

Get call log of a particular number

By : user2957027
Date : November 22 2020, 03:03 PM
wish helps you Not something I've ever tried but you need to use the 'selection' parameter of the query(...) method to specify the phone number.
Something like this might work...
code :
String numberToSearch = "01234567890";
String order = android.provider.CallLog.Calls.DATE + " DESC";

// The third parameter is for the 'selection'
Cursor cursor = context.getContentResolver().query(CallLog.Calls.CONTENT_URI, null, "NUMBER=" + numberToSearch, null, order);

if(cursor != null && cursor.count() > 0) {

    // If you got this far then you have at least one record
    // for the number you searched for

    int number = cursor.getColumnIndex(CallLog.Calls.NUMBER);
    int type = cursor.getColumnIndex(CallLog.Calls.TYPE);

    while(cursor.moveToNext()) {
        String phNum = cursor.getString(number);
        int callType = Integer.parseInt(cursor.getString(type));

        // Do what you need to do with phNum and callType

Share : facebook icon twitter icon
Call intent to make a call with put extra to select a phone number in Android?

Call intent to make a call with put extra to select a phone number in Android?

By : Dinesh
Date : March 29 2020, 07:55 AM
this will help I am trying to create a way a user can contact a friend via sms, email and a phone call. I have completed the email and SMS part. I have figured out how to use createChooser to select how a message will be sent using either email or text message, this is achieved by clicking on a button, the following code is how I do this: , Calling is acheived by using the tel: scheme, not using an extra:
code :
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:" + number));
how to link static cells to Outlet/Actions - E.G tap the call cell to call the number

how to link static cells to Outlet/Actions - E.G tap the call cell to call the number

By : Katelynn Ann McKay
Date : March 29 2020, 07:55 AM
Show Status Bar Notification from my Application when a Call is Received with the Incoming Call Number

Show Status Bar Notification from my Application when a Call is Received with the Incoming Call Number

By : plickoff
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I am creating an application and a certain part of my code I need to create a notification when I receive a call. The problem is that I am not able to implement the status bar notification, since I have to check the number in the database and then show the required data in Notification. , This might help some one. Here is the Implementation :
code :
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;

public class IncomingCall extends BroadcastReceiver {

    private Context mContext = null;
    NotificationManager NM;
    public String msg;

    public void onReceive(Context context, Intent intent) {
        mContext = context;

        try {
            // TELEPHONY MANAGER class object to register one listner
            TelephonyManager tmgr = (TelephonyManager) context

            // Create Listner
            MyPhoneStateListener PhoneListener = new MyPhoneStateListener();

            // Register listener for LISTEN_CALL_STATE
            tmgr.listen(PhoneListener, PhoneStateListener.LISTEN_CALL_STATE);

        } catch (Exception e) {
            Log.e("Phone Receive Error", " " + e);


    private class MyPhoneStateListener extends PhoneStateListener {

        public void onCallStateChanged(int state, String incomingNumber) {

            Log.d("MyPhoneListener", state + "   incoming no:" + incomingNumber);

            if (state == 1) {

                msg = incomingNumber;

    public void createNotification() {
        // Prepare intent which is triggered if the
        // notification is selected
        Intent intent = new Intent(mContext, NotificationImplementActivity.class);
        PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, intent,

        // Build notification
        // Actions are just fake
        Notification noti = new NotificationCompat.Builder(mContext)
                .setContentTitle("New Call from " + msg)
                .setContentText("Details :")
        NotificationManager notificationManager = (NotificationManager) mContext

        // hide the notification after its selected
        noti.flags |= Notification.FLAG_AUTO_CANCEL;

        notificationManager.notify(0, noti);

<receiver android:name=".IncomingCall" >
                <action android:name="android.intent.action.PHONE_STATE" />
how to call a recursion call N number of times, given the number N?

how to call a recursion call N number of times, given the number N?

By : Dokua
Date : March 29 2020, 07:55 AM
I hope this helps . I have an array of numbers: S= {4,5} and I want to check if this group creates the sum = 13.
code :
return isSumOf(s,n-s[0]) || isSumOf(s,n-s[1]);
for (int i = 0; i < s.length; ++i) {
  if (isSumOf(s,n-s[i])) return true;
return false;
boolean withoutLoop(int [] s,int n, int i) {
  if (i >= s.length) return false;
  return isSumOf(s,n-s[i]) || recurse(s, n, i+1);
public static boolean isSumOf(int [] s,int n)
    if(n == 0)
        return true;
    if(n < 0)
        return false;

    return withoutLoop(s, n, 0);  // Change here.
return (n == 0) || (n < 0 && withoutLoop(s, n, 0));
Get the number of click counts and call a single ajax call using jquery

Get the number of click counts and call a single ajax call using jquery

By : Martin
Date : March 29 2020, 07:55 AM
it should still fix some issue I need to call ajax service when the user continuously clicks a link but Now I have written for a single click. Once clicked ajax called and works fine but continuously clicks means takes only the first click alone. I need how many times clicked totally at the end call ajax service. Any helps greatly appreciated. Here's my code: , Suppose you have this element:
code :
<a href="#" onclick="call()" data-tag="Prev" id="prev"> Prev </a>
var count = 0, N = 5, timeInterval = 2000, isAlreadyClicked = false, intervalObj;
function call() {
    if (isAlreadyClicked) return;

    if (count >= N) {
        count = 0;
        isAlreadyClicked = true;

        // Make your AJAX call here
intervalObj = setInterval(() => count = 0, timeInterval);
count = 0, isAlreadyInProcess = false;
function call() {
    count ++;
    if (isAlreadyInProcess) return;
    isAlreadyInProcess = true;

    setTimeout(() => {
        // make your AJAX call
        // in the SUCCESS function of that, write:
    }, 1000);

function resetData() {
    count = 0;
    isAlreadyInProcess = false;
function ajaxCall() {
    return new Promise((resolve, reject) => {
        // make your ajax call and make sure to RESOLVE!
        // so that it goes to the chained THEN promise.
ajaxCall().then(res => {
Related Posts Related Posts :
  • Facebook login with Parse always returns false in user.isNew() Android
  • I get NullPointerException in an Android animation?
  • Things move out of place on different screen sizes
  • android database: the method open() is undefined for the type databasehelper class
  • sending intent with a parcelable extra from widget crashes on activity startup
  • How to record a video less than 10 mb using Android
  • Android - serialize object to pass it over Bluetooth NotSerializableException
  • Facebook Login Button Android in Eclipse
  • Null pointer exception on adding a marker to google maps
  • Jackson : Can not deserialize instance of java.util.ArrayList out of VALUE_TRUE token
  • How to customize PagerTitleStrip android
  • Click event not being captured for ListView items with HorizontalScrollView
  • HAX kernel module is not installed
  • Android: signed watchface on Android Wear 5.0 not installed
  • Dialog Builder in PreferenceFragment
  • HttpClient change UserAgent
  • Numerous 'No resource found' and 'Error retrieving parent' in Android Project
  • Invalid "--android-sdk" value "C:\android-sdk-win" in Titanium while deploying app on android mobile
  • Call onResume() method from Asynctask's onPostExecute() Method
  • Linking with native SO file present in included library project of Android
  • GridView error in horizontal spacing
  • Progressbar on bottom of listview item
  • Adding Markers on Google maps v2 Android
  • How to Remove Duplicate Libraries added via gradle?
  • Datepicker Dialog Validation...!
  • Scale image in ImageView to width of the parent and scale in height accordingly
  • user level api 19 failed to load. What files should i download
  • While running android AVD manager it shows error "HAX kernel module is not installed!"
  • Android application for limited enterprise audience
  • How to align different elements vertically in android studio?
  • Scroll View is not working when keyboard is open
  • Android phone Lg Realm(ls620) no driver found and can't find one online
  • Pros and cons for using external libraries in android project
  • What is the path of OAT file in Android 5.0
  • Actionbar Sherlock How to change drawer icon
  • how to pause progressbar in android
  • Styling composite views
  • Android, Eclipse: My app crashes on older API versions
  • Parcelable with arraylist<string> passing value from activity to fragment android
  • Why is there an extra part when parseUri() a String?
  • onItemClick and Toast don't work in a listfragment
  • Get input text with customview without edittext android
  • Getting value from the listview with custom adpter of selected checkbox to the activity
  • calculate value based on current and previous row in cursor android
  • How to save hashmap to shared preference?
  • How to Handle backPress with Fragment
  • DrawAllocation: Memory allocations within drawing code
  • Can I send Audio messages / notification in Android Auto?
  • Need layout design suggestion
  • Parse.com : Android how to store Image ParseFile in ParseObject in Offline Mode
  • Android Facebook LoginButton class not found
  • How to start another Activity using Button inside the Fragment
  • How to display video after getting from json?
  • Short black flashs when switching fragments in navigation drawer
  • Phonegap plugin does not work using remote build
  • Scrolling between dates in android
  • How to build system apps in Android Studio?
  • How to Display Dates in Calendar View from Database
  • How to give id of every fragment in and use it Tab Fragment android
  • org.json.JSONException: End of input at character 0 of
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org