Back to project page android-quiz-php.
The source code is released under:
Copyright (c) 2014, Fabricio Bedeschi All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...
If you think the Android project android-quiz-php listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.quiz.php.ui; /* ww w . j a v a 2 s . co m*/ import android.app.AlertDialog; import android.content.DialogInterface; import android.support.v4.app.Fragment; import com.quiz.php.R; import com.quiz.php.core.Quiz; /** * Created by fabricio on 1/29/14. */ public class QuizSummaryListActivity extends SingleFragmentActivity { @Override public Fragment createFragment() { return new QuizSummaryListFragment(); } /** * Take care of popping the fragment back stack or finishing the activity * as appropriate. */ @Override public void onBackPressed() { //show dialog if not finished final Quiz quiz = Quiz.get(this); if (! quiz.isFinish()) { new AlertDialog.Builder(this) .setTitle(R.string.close_title) .setMessage(R.string.close_msg) .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { quiz.setIsFinish(true); finish(); } }) .setNegativeButton(R.string.no, null) .show(); } else { super.onBackPressed(); } } }