Skip to content

Instantly share code, notes, and snippets.

@caner
Created February 14, 2014 08:22
Show Gist options
  • Save caner/8997547 to your computer and use it in GitHub Desktop.
Save caner/8997547 to your computer and use it in GitHub Desktop.
package com.example.locationmanager;
import android.app.Activity;
import android.content.Context;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class LocationManagerTestActivity extends Activity {
LocationManager lm;
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv=(TextView) findViewById(R.id.textView1);
lm=(LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
boolean isNetworkEnabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
String etkinMi = isNetworkEnabled ? "Etkin" : "Etkin değil";
Log.v("MainActivity", etkinMi);
tv.setText(etkinMi);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment