0
  1. I have Developed An Android App

  2. in That I have Rate this App Dialog(Rate and cancel and Remind me later). once I click Rate button it will go to play store Id, but if I click remind me later button I need to set three days after remind how should I implement this reminder

    code.

      AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(BookCompleteView.this);
               alertDialogBuilder.setTitle("Monn Message");

               alertDialogBuilder
                       .setMessage("If you Enjoy this App Please Rate this App")
                       .setCancelable(false)
                       .setPositiveButton("Rate",new DialogInterface.OnClickListener() {
                           public void onClick(DialogInterface dialog,int id) {
                               Uri uri = Uri.parse("market://details?id=" + BaseApplication.getInstance().getPackageName());
                               Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
                               goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
                                       Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
                                       Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
                               try {
                                   startActivity(goToMarket);
                               } catch (ActivityNotFoundException e) {
                                   startActivity(new Intent(Intent.ACTION_VIEW,
                                           Uri.parse("http://play.google.com/store/apps/details?id=" + BaseApplication.getInstance().getPackageName())));
                               }

                           }
                       })
                       .setNegativeButton("No Thanks",new DialogInterface.OnClickListener() {
                           public void onClick(DialogInterface dialog,int id) {

                               dialog.cancel();
                           }
                       }).setNeutralButton("Remind Me Later", new DialogInterface.OnClickListener() {
                   @Override
                   public void onClick(DialogInterface dialog, int which) {
                      // here i need to set three days after remind
                   }
               });


               AlertDialog alertDialog = alertDialogBuilder.create();
               alertDialog.show();
Community
  • 1
  • 1
PRP
  • 101
  • 9
  • Welcome to Stack Overflow! Please take the [tour](https://stackoverflow.com/tour), look around, and read through the [Help Center](https://stackoverflow.com/help), in particular [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) If you run into a specific problem, research it thoroughly, search thoroughly here, and if you're still stuck post your code and a description of the problem. Also, remember to include [Minimum, Complete, Verifiable Example](https://stackoverflow.com/help/mcve). People will be glad to help – Andreas Dec 07 '18 at 06:28

2 Answers2

0

You can achieve this way

1) store the Date and Time when user press Remind me later

2) And check the date while opening the app and if your stored date time and current time has 3 days difference than open your dialog

Milan Pansuriya
  • 2,521
  • 1
  • 19
  • 33
0

Save date in SharedPreference when user opens app for very first time. Compare saved date with todays date and if difference is more than 3 days then show your rating dialog.

Now after rating is given make another boolean sharedPreference to store where user has given rating or not. If it returns true then never ask user rating dialog again.

To compare two dates go through this code.

Ashish Kudale
  • 1,230
  • 1
  • 27
  • 51