Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bluetooth-receiver
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bruno Agrizzi
bluetooth-receiver
Commits
c1f2bb7c
Commit
c1f2bb7c
authored
May 03, 2016
by
Bruno Agrizzi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataStorage bug Fixed
parent
63aaa1b3
Pipeline
#43
skipped
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
misc.xml
.idea/misc.xml
+1
-1
DataListener.java
...va/com/example/brunoagrizzi/evologicabt/DataListener.java
+11
-7
No files found.
.idea/misc.xml
View file @
c1f2bb7c
...
...
@@ -37,7 +37,7 @@
<ConfirmationsSetting
value=
"0"
id=
"Add"
/>
<ConfirmationsSetting
value=
"0"
id=
"Remove"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
8
"
default=
"true"
assert-keyword=
"true"
jdk-15=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
7
"
default=
"true"
assert-keyword=
"true"
jdk-15=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
app/src/main/java/com/example/brunoagrizzi/evologicabt/DataListener.java
View file @
c1f2bb7c
...
...
@@ -210,7 +210,7 @@ public class DataListener extends AppCompatActivity {
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
int
id
=
item
.
getItemId
();
Boolean
hasMsg
=
false
;
if
(
id
==
R
.
id
.
action_settings
)
{
//Exporta dados
DataStorage
msgStore
=
new
DataStorage
();
...
...
@@ -219,15 +219,19 @@ public class DataListener extends AppCompatActivity {
String
[]
content
=
msg
.
get
(
"content"
).
toString
().
split
(
":"
);
responseData
=
responseData
+
msg
.
get
(
"timestamp"
).
toString
()
+
"\t"
;
responseData
=
responseData
+
content
[
1
]
+
"\n"
;
hasMsg
=
true
;
}
if
(
hasMsg
)
{
String
[]
initial
=
mMensagens
.
get
(
0
).
get
(
"timestamp"
).
toString
().
split
(
":"
);
String
dataInitial
=
initial
[
0
]+
"_"
+
initial
[
1
]+
"_"
+
initial
[
2
];
String
dataInitial
=
initial
[
0
]
+
"_"
+
initial
[
1
]
+
"_"
+
initial
[
2
];
String
[]
finaly
=
mMensagens
.
get
(
mMensagens
.
size
()-
1
).
get
(
"timestamp"
).
toString
().
split
(
":"
);
String
dataFinaly
=
finaly
[
0
]+
"_"
+
finaly
[
1
]+
"_"
+
finaly
[
2
];
String
[]
finaly
=
mMensagens
.
get
(
mMensagens
.
size
()
-
1
).
get
(
"timestamp"
).
toString
().
split
(
":"
);
String
dataFinaly
=
finaly
[
0
]
+
"_"
+
finaly
[
1
]
+
"_"
+
finaly
[
2
];
msgStore
.
salvarExternalStorage
(
responseData
,
mConnectedDeviceName
,
dataInitial
+
"-"
+
dataFinaly
);
Toast
.
makeText
(
DataListener
.
this
,
"Storage success"
,
Toast
.
LENGTH_SHORT
).
show
();
msgStore
.
salvarExternalStorage
(
responseData
,
mConnectedDeviceName
,
dataInitial
+
"-"
+
dataFinaly
);
Toast
.
makeText
(
DataListener
.
this
,
"Storage success"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
Toast
.
makeText
(
DataListener
.
this
,
"No Message to save"
,
Toast
.
LENGTH_SHORT
).
show
();
return
true
;
}
return
super
.
onOptionsItemSelected
(
item
);
...
...
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