Páginas

sábado, 27 de fevereiro de 2016

WM - Java Android GPS ON/OFF com Windev Mobile




//BroadcastReceiver GPS_On

import android.app.Activity;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

PUBLIC static void GPS_On()
{
Intent intent=new Intent("android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", True);
getActiviteEnCours().sendBroadcast(intent);
}


GPS_On()


//BroadcastReceiver GPS_Off

import android.app.Activity;
import java.lang.*;
import android.util.*;
import java.lang.Exception;
import android.util.Log;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

PUBLIC static void GPS_Off()
{
Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", False);
getActiviteEnCours().sendBroadcast(intent);
}


GPS_Off()









Nenhum comentário:

Postar um comentário