Back to project page notes.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> Everyone is permitted to copy and distribute verbatim or...
If you think the Android project notes 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 com.iliakplv.notes.gui.main.dialogs; //from w w w. j a v a 2 s .co m import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import com.iliakplv.notes.R; public class VoiceSearchInstallDialog extends DialogFragment { private static final String FRAGMENT_TAG = VoiceSearchInstallDialog.class.getSimpleName(); @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new AlertDialog.Builder(getActivity()) .setTitle(R.string.action_bar_speak) .setMessage(R.string.no_voice_search_dialog_text) .setNegativeButton(R.string.common_cancel, null) .setPositiveButton(R.string.no_voice_search_dialog_install, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.voicesearch")); startActivity(browserIntent); } }).create(); } public static void show(FragmentManager fm) { final VoiceSearchInstallDialog dialog = new VoiceSearchInstallDialog(); dialog.show(fm, FRAGMENT_TAG); } }