Android Open Source - detectivemode About Dialog Fragment






From Project

Back to project page detectivemode.

License

The source code is released under:

GNU General Public License

If you think the Android project detectivemode listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.dotslashzero.detectivemode.dialog;
//from  w  w w .  j  a  va 2 s  . co m
import net.dotslashzero.detectivemode.R;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

public class AboutDialogFragment extends DialogFragment
{
    public static AboutDialogFragment createInstance()
    {
        AboutDialogFragment aboutDlgFrag = new AboutDialogFragment();
        return (aboutDlgFrag);
    }

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState)
    {
        final Activity thisActivity = this.getActivity();

        AlertDialog.Builder dlgBuilder = new AlertDialog.Builder(this.getActivity());
        dlgBuilder
            .setIcon(R.drawable.ic_launcher)
            .setTitle(R.string.app_name)
            .setMessage(
                this.getActivity().getString(R.string.app_name) + " : "
                    + this.getActivity().getString(R.string.version_string) + System.lineSeparator()
                    + System.lineSeparator() + "This software is licensed under the GNU GPLv3.")
            .setNegativeButton("License", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton)
                {
                    Uri uri = Uri.parse("http://www.gnu.org/licenses/gpl-3.0.txt");
                    Intent viewIntent = new Intent(Intent.ACTION_VIEW, uri);
                    thisActivity.startActivity(viewIntent);
                    return;
                }
            }).setNeutralButton("Github", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int whichButton)
                {
                    Uri uri = Uri.parse("https://www.github.com/vycasas/detectivemode");
                    Intent viewIntent = new Intent(Intent.ACTION_VIEW, uri);
                    thisActivity.startActivity(viewIntent);
                    return;
                }
            }).setPositiveButton("OK", null);

        return (dlgBuilder.create());
    }
}




Java Source Code List

net.dotslashzero.detectivemode.ConfigCheck.java
net.dotslashzero.detectivemode.Core.java
net.dotslashzero.detectivemode.MainActivity.java
net.dotslashzero.detectivemode.dialog.AboutDialogFragment.java