Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
A4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mateo Schütt Zalabardo
A4
Commits
f1d4e9d8
Commit
f1d4e9d8
authored
2 years ago
by
Kacper Orzel
Browse files
Options
Downloads
Patches
Plain Diff
klar A4
parent
c0049f72
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/com/example/a4/MainActivity.java
+12
-1
12 additions, 1 deletion
app/src/main/java/com/example/a4/MainActivity.java
with
12 additions
and
1 deletion
app/src/main/java/com/example/a4/MainActivity.java
+
12
−
1
View file @
f1d4e9d8
...
@@ -22,6 +22,7 @@ import android.provider.MediaStore;
...
@@ -22,6 +22,7 @@ import android.provider.MediaStore;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
MainActivity
extends
AppCompatActivity
{
public
class
MainActivity
extends
AppCompatActivity
{
...
@@ -100,8 +101,18 @@ public class MainActivity extends AppCompatActivity {
...
@@ -100,8 +101,18 @@ public class MainActivity extends AppCompatActivity {
locationManager
.
removeUpdates
(
this
);
// Remove the listener after getting the location
locationManager
.
removeUpdates
(
this
);
// Remove the listener after getting the location
}
}
};
};
locationManager
.
requestLocationUpdates
(
LocationManager
.
GPS_PROVIDER
,
10
,
0
,
locationListener
);
locationManager
.
requestLocationUpdates
(
LocationManager
.
GPS_PROVIDER
,
10
,
0
,
locationListener
);
}
}
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
REQUEST_CAMERA_PERMISSION
)
{
if
(
grantResults
.
length
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
dispatchTakePictureIntent
();
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
"permission denied"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment