Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Ear recognition
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Boston University
Ear recognition
Commits
5ef2e626
Commit
5ef2e626
authored
Oct 16, 2015
by
Daniel Kornhauser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying to add a Listener in FolloupActivity to display case in CommCare
parent
a3d321ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
7 deletions
+30
-7
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
IntentTransferingFeatures.java
...com/aluxoft/earrecognition/IntentTransferingFeatures.java
+2
-2
SelectFollowupActivity.java
...oft/earrecognition/activities/SelectFollowupActivity.java
+27
-4
No files found.
app/src/main/AndroidManifest.xml
View file @
5ef2e626
...
...
@@ -48,7 +48,7 @@
</intent-filter>
</activity>
<activity
android:name=
".activities.Select
User
Activity"
>
<activity
android:name=
".activities.Select
Followup
Activity"
>
<intent-filter>
<action
android:name=
"com.auriclon.activity_select_user"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
...
...
app/src/main/java/com/aluxoft/earrecognition/IntentTransferingFeatures.java
View file @
5ef2e626
...
...
@@ -5,7 +5,7 @@ import android.app.ProgressDialog;
import
android.content.Intent
;
import
android.os.Bundle
;
import
com.aluxoft.earrecognition.activities.Select
User
Activity
;
import
com.aluxoft.earrecognition.activities.Select
Followup
Activity
;
import
java.util.concurrent.Callable
;
...
...
@@ -41,7 +41,7 @@ public class IntentTransferingFeatures extends Activity {
returningIntent
.
putExtra
(
"odk_intent_data"
,
//"Hello World"
Select
User
Activity
.
currentSerializedEar
Select
Followup
Activity
.
currentSerializedEar
);
IntentTransferingFeatures
.
this
.
setResult
(
Activity
.
RESULT_OK
,
returningIntent
);
finish
();
...
...
app/src/main/java/com/aluxoft/earrecognition/activities/Select
User
Activity.java
→
app/src/main/java/com/aluxoft/earrecognition/activities/Select
Followup
Activity.java
View file @
5ef2e626
...
...
@@ -4,12 +4,12 @@ import android.app.Activity;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.Button
;
import
android.widget.ListView
;
import
com.aluxoft.earrecognition.R
;
import
com.aluxoft.earrecognition.common.EarData
;
import
com.aluxoft.earrecognition.common.EarIdList
;
import
com.aluxoft.earrecognition.common.NameDistance
;
import
com.google.gson.Gson
;
...
...
@@ -18,7 +18,7 @@ import com.google.gson.Gson;
* Shows top 10 matches, allows to register if not match is satisfactory.
* TODO: Populate list
*/
public
class
Select
User
Activity
extends
Activity
{
public
class
Select
Followup
Activity
extends
Activity
{
public
static
String
currentSerializedEar
;
...
...
@@ -33,7 +33,7 @@ public class SelectUserActivity extends Activity {
String
list
=
this
.
getIntent
().
getStringExtra
(
"list"
);
this
.
earIdList
=
new
Gson
().
fromJson
(
list
,
EarIdList
.
class
);
Select
User
Activity
.
currentSerializedEar
=
this
.
earIdList
.
getCurrentFeature
().
serializeFeatures
();
Select
Followup
Activity
.
currentSerializedEar
=
this
.
earIdList
.
getCurrentFeature
().
serializeFeatures
();
Button
registerButton
=
(
Button
)
findViewById
(
R
.
id
.
register_commcare
);
...
...
@@ -46,13 +46,36 @@ public class SelectUserActivity extends Activity {
ListView
topNListView
=
(
ListView
)
findViewById
(
R
.
id
.
topNListView
);
topNListView
.
setAdapter
(
arrayAdapter
);
topNListView
.
setOnItemSelectedListener
(
new
AdapterView
.
OnItemSelectedListener
()
{
@Override
public
void
onItemSelected
(
AdapterView
<?>
adapterView
,
View
view
,
int
i
,
long
l
)
{
Intent
intent
=
new
Intent
(
"org.commcare.dalvik.action.CommCareSession"
);
String
sssd
=
""
;
sssd
+=
"COMMAND_ID"
+
" "
+
"m1"
+
" "
+
"CASE_ID"
+
" "
+
"case_id"
+
" "
+
earIdList
.
getTop
().
get
(
i
).
person
.
getCaseId
()
+
" "
+
// "99de08b8-7235-41ba-9dbe-d1e5d70575cf" + " " +
"COMMAND_ID"
+
" "
+
"m1-f1"
;
intent
.
putExtra
(
"ccodk_session_request"
,
sssd
);
SelectFollowupActivity
.
this
.
startActivity
(
intent
);
}
@Override
public
void
onNothingSelected
(
AdapterView
<?>
adapterView
)
{
}
});
registerButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
Intent
i
=
new
Intent
(
"org.commcare.dalvik.action.CommCareSession"
);
String
sssd
=
"COMMAND_ID"
+
" "
+
"root"
+
" "
+
"COMMAND_ID"
+
" "
+
"m0-f0"
;
i
.
putExtra
(
"ccodk_session_request"
,
sssd
);
Select
User
Activity
.
this
.
startActivity
(
i
);
Select
Followup
Activity
.
this
.
startActivity
(
i
);
}
});
...
...
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