Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
LSR_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
GyuhoLee
2020-06-16 19:30:36 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78aae3b8d82d6b7b7df1a67c0b297f29d0a14e3c
78aae3b8
1 parent
4c3cb830
[Update] DB insert num, onClick
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
source/android/app/src/main/java/com/khuhacker/pocketgym/FirstActivity.java
source/android/app/src/main/java/com/khuhacker/pocketgym/ReportActivity.java
source/android/app/src/main/java/com/khuhacker/pocketgym/FirstActivity.java
View file @
78aae3b
...
...
@@ -35,7 +35,9 @@ public class FirstActivity extends AppCompatActivity {
sql
=
"SELECT * FROM reports WHERE date="
+
getTime
+
";"
;
Cursor
cursor
=
db
.
rawQuery
(
sql
,
null
);
if
(
cursor
.
getCount
()
==
0
)
{
sql
=
String
.
format
(
"INSERT INTO reports VALUES('0','0','"
+
getTime
+
"');"
);
double
dValue
=
Math
.
random
();
int
iValue
=
(
int
)(
dValue
*
100
);
sql
=
String
.
format
(
"INSERT INTO reports VALUES('"
+
iValue
+
"','0','"
+
getTime
+
"');"
);
db
.
execSQL
(
sql
);
}
}
...
...
source/android/app/src/main/java/com/khuhacker/pocketgym/ReportActivity.java
View file @
78aae3b
package
com
.
khuhacker
.
pocketgym
;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteDatabase
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.TextView
;
...
...
@@ -110,4 +112,10 @@ public class ReportActivity extends AppCompatActivity {
lineChart
.
invalidate
();
}
public
void
onClick
(
View
view
)
{
if
(
view
.
getId
()
==
R
.
id
.
backBtn
){
finish
();
}
}
}
...
...
Please
register
or
login
to post a comment