Created
May 29, 2018 17:58
-
-
Save mibrahimdev/e7876d4513dbeac52371a695f0e55f70 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
public class LocationActivity extends AppCompatActivity { | |
... | |
private void bindLocationListener() { | |
//You can safely pass (this) as it expose only the type not the view | |
BoundLocationManager.bindLocationListenerIn(this, mGpsListener, getApplicationContext()); | |
} | |
@Overrideprotected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.location_activity); | |
if (!hasLocationPermission()){ | |
//ask for permissions | |
} else { | |
bindLocationListener(); | |
} | |
} | |
... | |
.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment