Google Play Store로 이동시키기
- 앱 리뷰 남기기 위한 유도 팝업(MaterialDialog 사용)
- app/build.grade
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.github.afollestad.material-dialogs:commons:0.8.5.5@aar') {
transitive = true
}
...
}
- Source
public void goPlayStore(String content, String positiveText, String negativeText) {
new MaterialDialog.Builder(ReviewActivity.this).content(content).positiveText(positiveText).neutralText(negativeText).onPositive(new MaterialDialog.SingleButtonCallback() {
public void onClick( MaterialDialog dialog, DialogAction which) {
String appPackageName = getPackageName();
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
}
}).show();
}
'Programming > Android' 카테고리의 다른 글
[Android] Debug & Release 동시에 두개 설치하기 (0) | 2017.10.12 |
---|---|
[Android] Handler & Looper (0) | 2017.10.05 |
[Android] 선택 되었을 때 Text Color 바꾸기 (0) | 2017.05.16 |
[Android] Square ImageView (정사각형 ImageView) (0) | 2017.05.03 |
[Android] Spannable (0) | 2017.01.02 |