Android Open Source - RateMyApp Open Play Store Action






From Project

Back to project page RateMyApp.

License

The source code is released under:

MIT License

If you think the Android project RateMyApp 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 com.mariosangiorgio.ratemyapp.actions;
//from  www  . j a  v  a 2s. c  o m
import android.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.mariosangiorgio.ratemyapp.PreferencesManager;

public class OpenPlayStoreAction implements Action{
    private final PreferencesManager preferencesManager;

    public OpenPlayStoreAction(PreferencesManager preferencesManager){
        if(preferencesManager == null){
            throw new IllegalArgumentException();
        }
        this.preferencesManager = preferencesManager;
    }

    @Override
    public void execute(Context context, FragmentManager fragmentManager) {
        try {
            context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + context.getPackageName())));
        } catch (android.content.ActivityNotFoundException e) {
            context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + context.getPackageName())));
        }
        preferencesManager.setAlertEnabled(false);
    }
}




Java Source Code List

com.mariosangiorgio.ratemyapp.ContextUtils.java
com.mariosangiorgio.ratemyapp.OptionalValue.java
com.mariosangiorgio.ratemyapp.PreferencesManager.java
com.mariosangiorgio.ratemyapp.RateMyAppBuilder.java
com.mariosangiorgio.ratemyapp.RateMyApp.java
com.mariosangiorgio.ratemyapp.SharedPreferencesManager.java
com.mariosangiorgio.ratemyapp.actions.Action.java
com.mariosangiorgio.ratemyapp.actions.OpenPlayStoreAction.java
com.mariosangiorgio.ratemyapp.actions.ShowDialogAction.java
com.mariosangiorgio.ratemyapp.dialogs.AbstractDialogFragment.java
com.mariosangiorgio.ratemyapp.dialogs.NumberOfStarsDialog.java
com.mariosangiorgio.ratemyapp.dialogs.SendEmailDialog.java
com.mariosangiorgio.ratemyapp.dialogs.WantToRateDialog.java
com.mariosangiorgio.ratemyapp.listeners.DialogClickListener.java
com.mariosangiorgio.ratemyapp.listeners.NumberOfStarsDialogListener.java
com.mariosangiorgio.ratemyapp.listeners.SentEmailDialogListener.java
com.mariosangiorgio.ratemyapp.listeners.WantToRateDialogListener.java
com.mariosangiorgio.ratemyapp.sample.MainActivity.java