Category «Android Basics»

Updating Notifications in Android

When you need to issue a notification multiple times for the same type of event, you should avoid making a completely new notification. Instead, you should consider updating a previous notification, either by changing some of its values or by adding to it, or both. The following section describes how to update notifications and also …

Adding Swipe-to-Refresh To Your App in Android

The swipe-to-refresh user interface pattern is implemented entirely within theSwipeRefreshLayout widget, which detects the vertical swipe, displays a distinctive progress bar, and triggers callback methods in your app. You enable this behavior by adding the widget to your layout file as the parent of a ListView or GridView, and implementing the refresh behavior that gets …

Responding to a Refresh Request in Android

This lesson shows you how to update your app when the user requests a manual refresh, whether the user triggers the refresh with a swipe gesture or by using the action bar refresh action. Respond to the Refresh Gesture When the user makes a swipe gesture, the system displays the progress indicator and calls your …

Adding Swipe-to-Refresh To Your App in Android

The swipe-to-refresh user interface pattern is implemented entirely within theSwipeRefreshLayout widget, which detects the vertical swipe, displays a distinctive progress bar, and triggers callback methods in your app. You enable this behavior by adding the widget to your layout file as the parent of a ListView or GridView, and implementing the refresh behavior that gets …

Remaining Backward Compatible in Android

The SearchView and action bar are only available on Android 3.0 and later. To support older platforms, you can fall back to the search dialog. The search dialog is a system provided UI that overlays on top of your application when invoked. Set Minimum and Target API levels To setup the search dialog, first declare …

Setting Up the App Bar in Android

In its most basic form, the action bar displays the title for the activity on one side and anoverflow menu on the other. Even in this simple form, the app bar provides useful information to the users, and helps to give Android apps a consistent look and feel. Figure 1. An app bar with the …