Created
February 14, 2014 08:22
-
-
Save caner/8997547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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