Back to project page EdmontonWifi.
The source code is released under:
MIT License
If you think the Android project EdmontonWifi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package hey.rich.edmontonwifi.fragments; /*from www . j av a2 s. co m*/ import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.os.Bundle; import android.provider.SearchRecentSuggestions; import hey.rich.edmontonwifi.utils.WifiSearchRecentSuggestionsProvider; public class ClearSearchHistoryDialogFragment extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstance) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage("Clear Search History?") .setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // Clear history SearchRecentSuggestions suggestions = new SearchRecentSuggestions( getActivity(), WifiSearchRecentSuggestionsProvider.AUTHORITY, WifiSearchRecentSuggestionsProvider.MODE); suggestions.clearHistory(); } }) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // Do nothing } }); return builder.create(); } }