Android Open Source - MockGPSPath Enable Mock Location Dialog Fragment






From Project

Back to project page MockGPSPath.

License

The source code is released under:

GNU General Public License

If you think the Android project MockGPSPath 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.rc.mockgpspath;
//  www .  j  a  v a2s . c  om
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;

/**
 * Dialog that is shown to the user if he has not enabled mock locations. All it
 * does is open the normal android settings page for that option.
 * 
 * @author Ryan
 * 
 */
public class EnableMockLocationDialogFragment {

  public final static int MOCKDIALOG = 426252;

  public static Dialog createDialog(final Activity activity) {
    AlertDialog.Builder builder = new Builder(activity);

    builder.setMessage(R.string.you_must_enable_allow_mock_locations_to_use_this_app_);
    builder.setPositiveButton(R.string.enable_now, new OnClickListener() {

      @Override
      public void onClick(DialogInterface dialog, int which) {
        activity.startActivity(new Intent().setClassName("com.android.settings", "com.android.settings.DevelopmentSettings"));
      }
    });
    builder.setNegativeButton(R.string.quit, new OnClickListener() {

      @Override
      public void onClick(DialogInterface dialog, int which) {
        activity.finish();
      }
    });
    builder.setCancelable(false);

    return builder.create();
  }

}




Java Source Code List

com.rc.mockgpspath.DraggableLayout.java
com.rc.mockgpspath.EnableMockLocationDialogFragment.java
com.rc.mockgpspath.MapsHelper.java
com.rc.mockgpspath.MockGPSMapView.java
com.rc.mockgpspath.MockGPSPathActivity.java
com.rc.mockgpspath.MockGPSPathService.java
com.rc.mockgpspath.NodeOverlay.java
com.rc.mockgpspath.quickaction.ActionItem.java
com.rc.mockgpspath.quickaction.PopupWindows.java
com.rc.mockgpspath.quickaction.QuickAction.java