Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pedro Branco
TravelBuddy
Commits
29543ef4
Commit
29543ef4
authored
Mar 20, 2017
by
Tanmim Hanifa
Browse files
Date from string parsed to date
parent
11d09ae8
Changes
1
Hide whitespace changes
Inline
Side-by-side
TravelPals/TravelPals/app/src/main/java/travelpals/travelpals/RegisterActivity.java
View file @
29543ef4
...
...
@@ -6,6 +6,7 @@ import android.support.v7.app.AppCompatActivity;
import
android.os.Bundle
;
import
android.text.Html
;
import
android.text.Spanned
;
import
android.text.format.DateFormat
;
import
android.text.method.LinkMovementMethod
;
import
android.view.View
;
import
android.widget.Button
;
...
...
@@ -21,15 +22,22 @@ import com.android.volley.toolbox.Volley;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
RegisterActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_register
);
final
EditText
etDob
=
(
EditText
)
findViewById
(
R
.
id
.
etDob
);
final
EditText
etName
=
(
EditText
)
findViewById
(
R
.
id
.
etName
);
final
EditText
etUsername
=
(
EditText
)
findViewById
(
R
.
id
.
etUsername
);
...
...
@@ -45,6 +53,8 @@ public class RegisterActivity extends AppCompatActivity {
final
Button
btnRegister
=
(
Button
)
findViewById
(
R
.
id
.
btnRegister
);
TextView
tvTerms
=(
TextView
)
findViewById
(
R
.
id
.
tvTerms
);
tvTerms
.
setClickable
(
true
);
tvTerms
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
...
...
@@ -68,6 +78,9 @@ public class RegisterActivity extends AppCompatActivity {
final
String
passwordAgain
=
etPasswordAgain
.
getText
().
toString
();
Date
cDate
=
new
Date
();
String
fDate
=
new
SimpleDateFormat
(
dob
).
format
(
cDate
);
if
(
name
.
isEmpty
())
{
AlertDialog
.
Builder
builder2
=
new
AlertDialog
.
Builder
(
RegisterActivity
.
this
);
builder2
.
setMessage
(
"Name field is empty"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment