poke GPS Button - Android Hardware

Android examples for Hardware:Gps

Description

poke GPS Button

Demo Code


//package com.java2s;

import android.app.Activity;

import android.content.Intent;

import android.net.Uri;

public class Main {
    private static void pokeGPSButton(Activity activity) {
        final Intent poke = new Intent();
        poke.setClassName("com.android.settings",
                "com.android.settings.widget.SettingsAppWidgetProvider");
        poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
        poke.setData(Uri.parse("3"));
        activity.sendBroadcast(poke);/* w  w  w. j  av  a 2s.c  om*/
    }
}

Related Tutorials