wsharba / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 1 forks source link

ExWidget ignores data for intent #1040

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Android intents generally have three inputs: an action, data, and extras

action: com.google.zxing.client.android.SCAN
data: 
extras:

action: org.myapp.COLLECT
data: 
extras: started=/externaltest/starttime, constant='----', randomNumber=random())

action: android.intent.action.VIEW
data: content://contacts/people/1

Collect's ExWidget correctly handles the first two cases, but does not handle 
the third. The relevant code is at:
https://code.google.com/p/opendatakit/source/browse/src/org/odk/collect/android/
external/ExternalAppsUtils.java?repo=collect#92

My guess is that we should have a data variable that we should use that gets 
passed to Uri.parse() inside Collect.

For example this code snippet:
String url = "http://www.example.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

Would be called like this...
<input 
appearance="ex:android.intent.action.VIEW(data='http://www.example.com')" 
ref="/data/viewsite" >

Original issue reported on code.google.com by yano...@nafundi.com on 5 Aug 2014 at 10:02

GoogleCodeExporter commented 9 years ago

Original comment by yano...@nafundi.com on 5 Aug 2014 at 10:02