package SHARK2.keymon.com.mx;


import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class mapa_cliente extends Activity implements B4AActivity{
	public static mapa_cliente mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	public static final boolean fullScreen = false;
	public static final boolean includeTitle = false;
    public static WeakReference<Activity> previousOne;
    public static boolean dontPause;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        mostCurrent = this;
		if (processBA == null) {
			processBA = new anywheresoftware.b4a.ShellBA(this.getApplicationContext(), null, null, "SHARK2.keymon.com.mx", "SHARK2.keymon.com.mx.mapa_cliente");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
            
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                BA.LogInfo("Killing previous instance (mapa_cliente).");
				p.finish();
			}
		}
        processBA.setActivityPaused(true);
        processBA.runHook("oncreate", this, null);
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
        WaitForLayout wl = new WaitForLayout();
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
		    BA.handler.postDelayed(wl, 5);

	}
	static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent == null)
				return;
            
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
        if (this != mostCurrent)
			return;
		activityBA = new BA(this, layout, processBA, "SHARK2.keymon.com.mx", "SHARK2.keymon.com.mx.mapa_cliente");
        
        processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (BA.isShellModeRuntimeCheck(processBA)) {
			if (isFirst)
				processBA.raiseEvent2(null, true, "SHELL", false);
			processBA.raiseEvent2(null, true, "CREATE", true, "SHARK2.keymon.com.mx.mapa_cliente", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (mapa_cliente) Create " + (isFirst ? "(first time)" : "") + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (mapa_cliente) Resume **");
        processBA.raiseEvent(null, "activity_resume");
        if (android.os.Build.VERSION.SDK_INT >= 11) {
			try {
				android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
        try {
            if (processBA.subExists("activity_actionbarhomeclick")) {
                Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
                    getClass().getMethod("getActionBar").invoke(this), true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
            return true;
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
            if (android.os.Build.VERSION.SDK_INT >= 11) {
				try {
                    if (bmi.addToBar) {
				        android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
                    }
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
        
		return true;
	}   
 @Override
 public boolean onOptionsItemSelected(android.view.MenuItem item) {
    if (item.getItemId() == 16908332) {
        processBA.raiseEvent(null, "activity_actionbarhomeclick");
        return true;
    }
    else
        return super.onOptionsItemSelected(item); 
}
@Override
 public boolean onPrepareOptionsMenu(android.view.Menu menu) {
    super.onPrepareOptionsMenu(menu);
    processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
    return true;
    
 }
 protected void onStart() {
    super.onStart();
    processBA.runHook("onstart", this, null);
}
 protected void onStop() {
    super.onStop();
    processBA.runHook("onstop", this, null);
}
    public void onWindowFocusChanged(boolean hasFocus) {
       super.onWindowFocusChanged(hasFocus);
       if (processBA.subExists("activity_windowfocuschanged"))
           processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
    }
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEventFromUI(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return mapa_cliente.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
            return true;
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
					android.os.Build.VERSION.SDK_INT >= 18) {
				HandleKeyDelayed hk = new HandleKeyDelayed();
				hk.kc = keyCode;
				BA.handler.post(hk);
				return true;
			}
			else {
				boolean res = new HandleKeyDelayed().runDirectly(keyCode);
				if (res)
					return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
	private class HandleKeyDelayed implements Runnable {
		int kc;
		public void run() {
			runDirectly(kc);
		}
		public boolean runDirectly(int keyCode) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true) {
                return true;
            }
            else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
				finish();
				return true;
			}
            return false;
		}
		
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
            return true;
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
        super.onNewIntent(intent);
		this.setIntent(intent);
        processBA.runHook("onnewintent", this, new Object[] {intent});
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null)
            return;
        if (this != mostCurrent)
			return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        if (!dontPause)
            BA.LogInfo("** Activity (mapa_cliente) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (mapa_cliente) Pause event (activity is not paused). **");
        if (mostCurrent != null)
            processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        if (!dontPause) {
            processBA.setActivityPaused(true);
            mostCurrent = null;
        }

        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        processBA.runHook("onpause", this, null);
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
        processBA.runHook("ondestroy", this, null);
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
        processBA.runHook("onresume", this, null);
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
            mapa_cliente mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (mapa_cliente) Resume **");
            if (mc != mostCurrent)
                return;
		    processBA.raiseEvent(mc._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
        processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}
    public void onRequestPermissionsResult(int requestCode,
        String permissions[], int[] grantResults) {
        for (int i = 0;i < permissions.length;i++) {
            Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
            processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
        }
            
    }



public static void initializeProcessGlobals() {
             try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
}
public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.gps.GPS _gps = null;
public static anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public static String _ruta = "";
public static anywheresoftware.b4a.sql.SQL _skmt = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper.GoogleMapWrapper _gmap = null;
public anywheresoftware.b4a.objects.MapFragmentWrapper _mapfragment1 = null;
public static double _latitud = 0;
public static double _longitud = 0;
public static double _lat2 = 0;
public static double _lon2 = 0;
public anywheresoftware.b4a.gps.LocationWrapper _p1 = null;
public anywheresoftware.b4a.gps.LocationWrapper _p2 = null;
public static float _distance = 0f;
public anywheresoftware.b4a.objects.ButtonWrapper _boton1 = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public static String _latmarker = "";
public static String _longmarker = "";
public anywheresoftware.b4a.objects.LabelWrapper _l_long = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_lat = null;
public static String _nombre_tienda = "";
public anywheresoftware.b4a.objects.PanelWrapper _p_principal = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_regresar = null;
public b4a.example.dateutils _dateutils = null;
public SHARK2.keymon.com.mx.main _main = null;
public SHARK2.keymon.com.mx.appupdater _appupdater = null;
public SHARK2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public SHARK2.keymon.com.mx.notificationservice _notificationservice = null;
public SHARK2.keymon.com.mx.pendientes _pendientes = null;
public SHARK2.keymon.com.mx.starter _starter = null;
public SHARK2.keymon.com.mx.subs _subs = null;
public SHARK2.keymon.com.mx.tracker _tracker = null;
public SHARK2.keymon.com.mx.newinst2 _newinst2 = null;
public SHARK2.keymon.com.mx.b4xpages _b4xpages = null;
public SHARK2.keymon.com.mx.b4xcollections _b4xcollections = null;
public SHARK2.keymon.com.mx.httputils2service _httputils2service = null;
public SHARK2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public static String  _activity_create(boolean _firsttime) throws Exception{
RDebugUtils.currentModule="mapa_cliente";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_create", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_create", new Object[] {_firsttime}));}
RDebugUtils.currentLine=33226752;
 //BA.debugLineNum = 33226752;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
RDebugUtils.currentLine=33226753;
 //BA.debugLineNum = 33226753;BA.debugLine="Activity.LoadLayout(\"mapa_cliente\")";
mostCurrent._activity.LoadLayout("mapa_cliente",mostCurrent.activityBA);
RDebugUtils.currentLine=33226754;
 //BA.debugLineNum = 33226754;BA.debugLine="If MapFragment1.IsGooglePlayServicesAvailable = F";
if (mostCurrent._mapfragment1.IsGooglePlayServicesAvailable(mostCurrent.activityBA)==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=33226755;
 //BA.debugLineNum = 33226755;BA.debugLine="ToastMessageShow(\"Please install Google Play Ser";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Please install Google Play Services."),anywheresoftware.b4a.keywords.Common.True);
 };
RDebugUtils.currentLine=33226757;
 //BA.debugLineNum = 33226757;BA.debugLine="End Sub";
return "";
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
RDebugUtils.currentModule="mapa_cliente";
RDebugUtils.currentLine=33488896;
 //BA.debugLineNum = 33488896;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
RDebugUtils.currentLine=33488897;
 //BA.debugLineNum = 33488897;BA.debugLine="GPS.Stop";
_gps.Stop();
RDebugUtils.currentLine=33488898;
 //BA.debugLineNum = 33488898;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
RDebugUtils.currentModule="mapa_cliente";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_resume", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_resume", null));}
RDebugUtils.currentLine=33423360;
 //BA.debugLineNum = 33423360;BA.debugLine="Sub Activity_Resume";
RDebugUtils.currentLine=33423361;
 //BA.debugLineNum = 33423361;BA.debugLine="Subs.centraBoton(b_regresar, Activity.Width)";
mostCurrent._subs._centraboton /*String*/ (mostCurrent.activityBA,mostCurrent._b_regresar,mostCurrent._activity.getWidth());
RDebugUtils.currentLine=33423362;
 //BA.debugLineNum = 33423362;BA.debugLine="GPS.Initialize(\"GPS\")";
_gps.Initialize("GPS");
RDebugUtils.currentLine=33423363;
 //BA.debugLineNum = 33423363;BA.debugLine="If GPS.GPSEnabled = False Then";
if (_gps.getGPSEnabled()==anywheresoftware.b4a.keywords.Common.False) { 
RDebugUtils.currentLine=33423364;
 //BA.debugLineNum = 33423364;BA.debugLine="ToastMessageShow(\"Debe Activar el GPS del Equipo";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("Debe Activar el GPS del Equipo."),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=33423365;
 //BA.debugLineNum = 33423365;BA.debugLine="StartActivity(GPS.LocationSettingsIntent)";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)(_gps.getLocationSettingsIntent()));
 }else {
RDebugUtils.currentLine=33423367;
 //BA.debugLineNum = 33423367;BA.debugLine="GPS.Start(0, 0)";
_gps.Start(processBA,(long) (0),(float) (0));
 };
RDebugUtils.currentLine=33423369;
 //BA.debugLineNum = 33423369;BA.debugLine="c = Starter.skmt.ExecQuery(\"SELECT CAT_CL_LAT, CA";
mostCurrent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_LAT, CAT_CL_LONG, CAT_CL_NOMBRE FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION ALL SELECT CAT_CL_LAT, CAT_CL_LONG, CAT_CL_NOMBRE FROM kmt_info2 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=33423371;
 //BA.debugLineNum = 33423371;BA.debugLine="If c.RowCount > 0 Then";
if (mostCurrent._c.getRowCount()>0) { 
RDebugUtils.currentLine=33423372;
 //BA.debugLineNum = 33423372;BA.debugLine="c.Position = 0";
mostCurrent._c.setPosition((int) (0));
RDebugUtils.currentLine=33423373;
 //BA.debugLineNum = 33423373;BA.debugLine="Subs.centraPanel(p_principal, Activity.Width)";
mostCurrent._subs._centrapanel /*String*/ (mostCurrent.activityBA,mostCurrent._p_principal,mostCurrent._activity.getWidth());
RDebugUtils.currentLine=33423374;
 //BA.debugLineNum = 33423374;BA.debugLine="p_principal.Height = Activity.Height	* 0.95";
mostCurrent._p_principal.setHeight((int) (mostCurrent._activity.getHeight()*0.95));
RDebugUtils.currentLine=33423375;
 //BA.debugLineNum = 33423375;BA.debugLine="latmarker = c.GetString(\"CAT_CL_LAT\")";
mostCurrent._latmarker = mostCurrent._c.GetString("CAT_CL_LAT");
RDebugUtils.currentLine=33423376;
 //BA.debugLineNum = 33423376;BA.debugLine="longmarker =  c.GetString(\"CAT_CL_LONG\")";
mostCurrent._longmarker = mostCurrent._c.GetString("CAT_CL_LONG");
RDebugUtils.currentLine=33423377;
 //BA.debugLineNum = 33423377;BA.debugLine="NOMBRE_TIENDA = c.GetString(\"CAT_CL_NOMBRE\")";
mostCurrent._nombre_tienda = mostCurrent._c.GetString("CAT_CL_NOMBRE");
 };
RDebugUtils.currentLine=33423379;
 //BA.debugLineNum = 33423379;BA.debugLine="End Sub";
return "";
}
public static String  _b_regresar_click() throws Exception{
RDebugUtils.currentModule="mapa_cliente";
if (Debug.shouldDelegate(mostCurrent.activityBA, "b_regresar_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "b_regresar_click", null));}
RDebugUtils.currentLine=33619968;
 //BA.debugLineNum = 33619968;BA.debugLine="Private Sub b_regresar_Click";
RDebugUtils.currentLine=33619969;
 //BA.debugLineNum = 33619969;BA.debugLine="Log(\"Pressed\")";
anywheresoftware.b4a.keywords.Common.LogImpl("533619969","Pressed",0);
RDebugUtils.currentLine=33619970;
 //BA.debugLineNum = 33619970;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
RDebugUtils.currentLine=33619971;
 //BA.debugLineNum = 33619971;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Cliente");
RDebugUtils.currentLine=33619972;
 //BA.debugLineNum = 33619972;BA.debugLine="End Sub";
return "";
}
public static String  _gps_locationchanged(anywheresoftware.b4a.gps.LocationWrapper _parametro) throws Exception{
RDebugUtils.currentModule="mapa_cliente";
if (Debug.shouldDelegate(mostCurrent.activityBA, "gps_locationchanged", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "gps_locationchanged", new Object[] {_parametro}));}
RDebugUtils.currentLine=33357824;
 //BA.debugLineNum = 33357824;BA.debugLine="Sub GPS_LocationChanged (Parametro As Location)";
RDebugUtils.currentLine=33357843;
 //BA.debugLineNum = 33357843;BA.debugLine="End Sub";
return "";
}
public static void  _mapfragment1_ready() throws Exception{
RDebugUtils.currentModule="mapa_cliente";
if (Debug.shouldDelegate(mostCurrent.activityBA, "mapfragment1_ready", false))
	 {Debug.delegate(mostCurrent.activityBA, "mapfragment1_ready", null); return;}
ResumableSub_MapFragment1_Ready rsub = new ResumableSub_MapFragment1_Ready(null);
rsub.resume(processBA, null);
}
public static class ResumableSub_MapFragment1_Ready extends BA.ResumableSub {
public ResumableSub_MapFragment1_Ready(SHARK2.keymon.com.mx.mapa_cliente parent) {
this.parent = parent;
}
SHARK2.keymon.com.mx.mapa_cliente parent;
String _permission = "";
boolean _result = false;
anywheresoftware.b4j.object.JavaObject _javamapsobject = null;
anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper _marcador1 = null;
anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper _aa = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="mapa_cliente";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=33292289;
 //BA.debugLineNum = 33292289;BA.debugLine="gmap = MapFragment1.GetMap";
parent.mostCurrent._gmap = parent.mostCurrent._mapfragment1.GetMap();
RDebugUtils.currentLine=33292291;
 //BA.debugLineNum = 33292291;BA.debugLine="rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCA";
parent._rp.CheckAndRequest(processBA,parent._rp.PERMISSION_ACCESS_FINE_LOCATION);
RDebugUtils.currentLine=33292292;
 //BA.debugLineNum = 33292292;BA.debugLine="Wait For Activity_PermissionResult (Permission As";
anywheresoftware.b4a.keywords.Common.WaitFor("activity_permissionresult", processBA, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "mapa_cliente", "mapfragment1_ready"), null);
this.state = 5;
return;
case 5:
//C
this.state = 1;
_permission = (String) result[0];
_result = (Boolean) result[1];
;
RDebugUtils.currentLine=33292293;
 //BA.debugLineNum = 33292293;BA.debugLine="gmap.MyLocationEnabled = Result";
parent.mostCurrent._gmap.setMyLocationEnabled(_result);
RDebugUtils.currentLine=33292295;
 //BA.debugLineNum = 33292295;BA.debugLine="Dim JavaMapsObject As JavaObject";
_javamapsobject = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=33292296;
 //BA.debugLineNum = 33292296;BA.debugLine="JavaMapsObject = gmap.GetUiSettings";
_javamapsobject = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(parent.mostCurrent._gmap.GetUiSettings().getObject()));
RDebugUtils.currentLine=33292297;
 //BA.debugLineNum = 33292297;BA.debugLine="JavaMapsObject.RunMethod(\"setMapToolbarEnabled\",";
_javamapsobject.RunMethod("setMapToolbarEnabled",new Object[]{(Object)(anywheresoftware.b4a.keywords.Common.True)});
RDebugUtils.currentLine=33292298;
 //BA.debugLineNum = 33292298;BA.debugLine="Dim marcador1 As Marker = gmap.AddMarker (latmark";
_marcador1 = new anywheresoftware.b4a.objects.MapFragmentWrapper.MarkerWrapper();
_marcador1 = parent.mostCurrent._gmap.AddMarker((double)(Double.parseDouble(parent.mostCurrent._latmarker)),(double)(Double.parseDouble(parent.mostCurrent._longmarker)),"TIENDA");
RDebugUtils.currentLine=33292299;
 //BA.debugLineNum = 33292299;BA.debugLine="c = Starter.skmt.ExecQuery(\"SELECT CAT_CL_LAT, CA";
parent.mostCurrent._c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent.mostCurrent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("SELECT CAT_CL_LAT, CAT_CL_LONG, CAT_CL_NOMBRE FROM kmt_info WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) UNION ALL SELECT CAT_CL_LAT, CAT_CL_LONG, CAT_CL_NOMBRE FROM kmt_info2 WHERE CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA)")));
RDebugUtils.currentLine=33292301;
 //BA.debugLineNum = 33292301;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

case 1:
//if
this.state = 4;
if (parent.mostCurrent._c.getRowCount()>0) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=33292302;
 //BA.debugLineNum = 33292302;BA.debugLine="c.Position = 0";
parent.mostCurrent._c.setPosition((int) (0));
RDebugUtils.currentLine=33292308;
 //BA.debugLineNum = 33292308;BA.debugLine="marcador1.Snippet = c.GetString(\"CAT_CL_NOMBRE\")";
_marcador1.setSnippet(parent.mostCurrent._c.GetString("CAT_CL_NOMBRE"));
 if (true) break;

case 4:
//C
this.state = -1;
;
RDebugUtils.currentLine=33292311;
 //BA.debugLineNum = 33292311;BA.debugLine="Dim aa As CameraPosition";
_aa = new anywheresoftware.b4a.objects.MapFragmentWrapper.CameraPositionWrapper();
RDebugUtils.currentLine=33292312;
 //BA.debugLineNum = 33292312;BA.debugLine="aa.Initialize(latmarker,longmarker,15)''' RECOMEN";
_aa.Initialize((double)(Double.parseDouble(parent.mostCurrent._latmarker)),(double)(Double.parseDouble(parent.mostCurrent._longmarker)),(float) (15));
RDebugUtils.currentLine=33292313;
 //BA.debugLineNum = 33292313;BA.debugLine="gmap.AnimateCamera(aa)";
parent.mostCurrent._gmap.AnimateCamera((com.google.android.gms.maps.model.CameraPosition)(_aa.getObject()));
RDebugUtils.currentLine=33292314;
 //BA.debugLineNum = 33292314;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _reg_click() throws Exception{
RDebugUtils.currentModule="mapa_cliente";
if (Debug.shouldDelegate(mostCurrent.activityBA, "reg_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "reg_click", null));}
RDebugUtils.currentLine=33554432;
 //BA.debugLineNum = 33554432;BA.debugLine="Sub reg_Click";
RDebugUtils.currentLine=33554434;
 //BA.debugLineNum = 33554434;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
mostCurrent._b4xpages._showpage /*String*/ (mostCurrent.activityBA,"Cliente");
RDebugUtils.currentLine=33554435;
 //BA.debugLineNum = 33554435;BA.debugLine="End Sub";
return "";
}
}