Skip to content

Commit

Permalink
fix on action listener
Browse files Browse the repository at this point in the history
  • Loading branch information
pocho23 committed Mar 12, 2015
1 parent 2ef9e1e commit 2482b09
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions LibraryRateMe/src/com/androidsx/rateme/DialogRateMe.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ public void onClick(View v) {
RateMeDialogTimer.clearSharedPreferences(getActivity());
Log.d(TAG, "clear preferences");
RateMeDialogTimer.setOptOut(getActivity(), true);
onActionListener.onHandleRateMeAction(RateMeAction.DISMISSED_WITH_CROSS, ratingBar.getRating());
if (onActionListener != null) {
onActionListener.onHandleRateMeAction(RateMeAction.DISMISSED_WITH_CROSS, ratingBar.getRating());
}
}
});

Expand All @@ -144,7 +146,10 @@ public void onClick(View v) {
public void onClick(View v) {
startActivity(shareApp(appPackageName));
Log.d(TAG, "share App");
onActionListener.onHandleRateMeAction(RateMeAction.SHARED_APP, ratingBar.getRating());
if (onActionListener != null) {
onActionListener.onHandleRateMeAction(RateMeAction.SHARED_APP, ratingBar.getRating());
}

}
});
}catch (Exception e){
Expand Down Expand Up @@ -261,7 +266,9 @@ public void onClick(View v) {
rateApp();
Log.d(TAG, "go to Google Play Store for Rate-Me");
RateMeDialogTimer.setOptOut(getActivity(), true);
onActionListener.onHandleRateMeAction(RateMeAction.HIGH_RATING_WENT_TO_GOOGLE_PLAY, ratingBar.getRating());
if (onActionListener != null) {
onActionListener.onHandleRateMeAction(RateMeAction.HIGH_RATING_WENT_TO_GOOGLE_PLAY, ratingBar.getRating());
}
dismiss();
}
});
Expand All @@ -276,7 +283,9 @@ public void onClick(View v) {
Log.d(TAG, "got to Mail for explain what is the problem");
} else {
dismiss();
onActionListener.onHandleRateMeAction(RateMeAction.LOW_RATING, ratingBar.getRating());
if (onActionListener != null) {
onActionListener.onHandleRateMeAction(RateMeAction.LOW_RATING, ratingBar.getRating());
}
}
RateMeDialogTimer.setOptOut(getActivity(), true);
}
Expand Down

0 comments on commit 2482b09

Please sign in to comment.