android: fixing intent issue with video capture path
@@ -12,6 +12,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
+import android.net.Uri.Builder;
import android.os.Build;
import android.os.Bundle;
@@ -172,18 +173,31 @@ public class IntentSingleton extends AbstractRhoListener implements IIntentSingl
for (Map.Entry<String, Object> entry: extras.entrySet()) {
if (String.class.isInstance(entry.getValue())) {
+ if (entry.getKey().equals("output") && intent.toString().contains("VIDEO_CAPTURE")){
+ Logger.T(TAG, "Action is VIDEO_CAPTURE");
+ try{
+ intent.putExtra(constant(entry.getKey()), Uri.parse((String)entry.getValue()));
+ }catch(Exception e){Logger.T(TAG, "Error on building intent: " + e.getMessage());}
+ }else{
intent.putExtra(constant(entry.getKey()), (String)entry.getValue());
+ Logger.T(TAG, "Putting extra to intent: key - " + entry.getKey() + ", type - String");
+ }
+
}
else if (Boolean.class.isInstance(entry.getValue())) {
intent.putExtra(constant(entry.getKey()), ((Boolean)entry.getValue()).booleanValue());
+ Logger.T(TAG, "Putting extra to intent: key - " + entry.getKey() + ", type - Boolean");
}
else if (Integer.class.isInstance(entry.getValue())) {
intent.putExtra(constant(entry.getKey()), ((Integer)entry.getValue()).intValue());
+ Logger.T(TAG, "Putting extra to intent: key - " + entry.getKey() + ", type - Int");
}
else if (Double.class.isInstance(entry.getValue())) {
intent.putExtra(constant(entry.getKey()), ((Double)entry.getValue()).doubleValue());
+ Logger.T(TAG, "Putting extra to intent: key - " + entry.getKey() + ", type - Double");
}
else if (ArrayList.class.isInstance(entry.getValue())) {
+ Logger.T(TAG, "Putting extra to intent: key - " + entry.getKey() + ", type - ArrayList");
ArrayList list = (ArrayList)entry.getValue();
if ( list.size() > 0 ) {
if (String.class.isInstance(list.get(0))) {
