Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KeepMeSafe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vivek s
KeepMeSafe
Commits
c4b4514f
Commit
c4b4514f
authored
8 years ago
by
viveksvdy2014
Browse files
Options
Downloads
Patches
Plain Diff
Made OIN Accepting Automatic
''
parent
dc9dc3ae
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/com/speedyapps/keepyousafe/confirmationScreen.java
+23
-2
23 additions, 2 deletions
...n/java/com/speedyapps/keepyousafe/confirmationScreen.java
app/src/main/res/layout/activity_confirmation_screen.xml
+1
-13
1 addition, 13 deletions
app/src/main/res/layout/activity_confirmation_screen.xml
with
24 additions
and
15 deletions
app/src/main/java/com/speedyapps/keepyousafe/confirmationScreen.java
+
23
−
2
View file @
c4b4514f
...
@@ -24,14 +24,15 @@ public class confirmationScreen extends AppCompatActivity {
...
@@ -24,14 +24,15 @@ public class confirmationScreen extends AppCompatActivity {
public
static
String
file1
=
"MyPREFERENCES"
;
public
static
String
file1
=
"MyPREFERENCES"
;
public
static
String
file2
=
"PREFERENCES"
;
public
static
String
file2
=
"PREFERENCES"
;
public
static
String
file3
=
"COUNT"
;
public
static
String
file3
=
"COUNT"
;
Handler
handler
;
Handler
handler
,
handler2
;
Intent
alarmIntent
;
Intent
alarmIntent
;
Runnable
run
;
Runnable
run
,
run2
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_confirmation_screen
);
setContentView
(
R
.
layout
.
activity_confirmation_screen
);
handler
=
new
Handler
();
handler
=
new
Handler
();
handler2
=
new
Handler
();
alarmIntent
=
new
Intent
(
confirmationScreen
.
this
,
alarmService
.
class
);
alarmIntent
=
new
Intent
(
confirmationScreen
.
this
,
alarmService
.
class
);
textView
=
(
TextView
)
findViewById
(
R
.
id
.
countDown
);
textView
=
(
TextView
)
findViewById
(
R
.
id
.
countDown
);
editText
=(
EditText
)
findViewById
(
R
.
id
.
editTextPIN
);
editText
=(
EditText
)
findViewById
(
R
.
id
.
editTextPIN
);
...
@@ -51,7 +52,27 @@ public class confirmationScreen extends AppCompatActivity {
...
@@ -51,7 +52,27 @@ public class confirmationScreen extends AppCompatActivity {
handler
.
postDelayed
(
this
,
1000
);
handler
.
postDelayed
(
this
,
1000
);
}
}
};
};
run2
=
new
Runnable
()
{
@Override
public
void
run
()
{
if
((!
editText
.
getText
().
toString
().
equals
(
"2020"
))&&
textView
.
getText
().
toString
().
equals
(
"0"
))
{
distressCall
();
}
else
if
(
editText
.
getText
().
toString
().
equals
(
"2020"
)){
handler
.
removeCallbacks
(
run
);
handler2
.
removeCallbacks
(
this
);
Toast
.
makeText
(
confirmationScreen
.
this
,
"Distress Calls Cancelled!"
,
Toast
.
LENGTH_SHORT
).
show
();
Intent
main
=
new
Intent
(
confirmationScreen
.
this
,
MainActivity
.
class
);
stopService
(
alarmIntent
);
startActivity
(
main
);
}
else
if
((!
editText
.
getText
().
toString
().
equals
(
"2020"
)))
handler2
.
post
(
this
);
}
};
handler2
.
post
(
run2
);
handler
.
post
(
run
);
handler
.
post
(
run
);
}
}
public
void
onCancel
(
View
view
){
public
void
onCancel
(
View
view
){
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_confirmation_screen.xml
+
1
−
13
View file @
c4b4514f
...
@@ -49,20 +49,8 @@
...
@@ -49,20 +49,8 @@
android:textStyle=
"normal|bold"
android:textStyle=
"normal|bold"
android:textColor=
"@android:color/holo_red_dark"
/>
android:textColor=
"@android:color/holo_red_dark"
/>
<Button
android:text=
"CANCEL"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"15dp"
android:id=
"@+id/buttonCANCEL"
android:layout_below=
"@+id/editTextPIN"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
style=
"@android:style/Widget.Holo.Button"
android:onClick=
"onCancel"
/>
<TextView
<TextView
android:text=
"If this is a FALSEALARM OR ACCIDENT, please ENTER THE PIN
AND press
CANCEL!"
android:text=
"If this is a FALSEALARM OR ACCIDENT, please ENTER THE PIN
to
CANCEL!"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/textView3"
android:id=
"@+id/textView3"
...
...
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