You need to use limit clause in your content query to get the last call details.
So your content query will become
Cursor cur = getContentResolver().query( CallLog.Calls.CONTENT_URI,
null, null, null, android.provider.CallLog.Calls.DATE + " DESC limit 1;");
More Related Contents:
- How to implement a ContentObserver for call logs
- Android app opens and crashes when there is no internet
- How to parse this? [closed]
- TileProvider using local tiles
- How to use JNI bitmap operations for helping to avoid OOM when using large images? [closed]
- How to solve java.lang.OutOfMemoryError trouble in Android
- Android Service Stops When App Is Closed
- Android 4.3 menu item showAsAction=”always” ignored
- Round corner for BottomSheetDialogFragment
- Android M Permissions : Confused on the usage of shouldShowRequestPermissionRationale() function
- What’s the difference between fill_parent and wrap_content?
- Determine addAction click for Android notifications
- Android – footer scrolls off screen when used in CoordinatorLayout
- Listen outgoing SMS or sent box in Android
- Espresso – How can I check if an activity is launched after performing a certain action?
- Generate barcode image in Android application
- Android Studio cannot resolve R in imported project?
- RecyclerView is cutting off the last item
- How to handle AsyncTask onPostExecute when paused to avoid IllegalStateException
- Android error “unable to find explicit activity class”
- Android emulator freezing OS X v10.9 (Mavericks) with HAXM
- Android ImageView size not scaling with source image
- Only use XHDPI drawables in Android app?
- Missing annotations.jar
- AppCompat 23.3 Support Vectors no longer work?
- Android Q (10) ask permission to get access all storage. Scoped storage
- Flutter TabBar and SliverAppBar that hides when you scroll down
- How to display a Toast in Android AsyncTask?
- Transforming accelerometer’s data from device’s coordinates to real world coordinates
- Your APP_BUILD_SCRIPT points to an unknown file using Android ndk-build