Rho::Intent.send relaunches app at end of activity

// Expert user has replied.
G Gert Vandelaer 3 years 7 months ago
1 1 0

Hi all,

I'm trying to figure out Intents in Rhomobile (git rhodes 5-0-stable)

I made a controller function like this (docs are not clear for me about callback handler) :

def open_native_camera
  puts "Open Native camera app"
  intent_params = { :action     => "android.media.action.IMAGE_CAPTURE",
                    :intentType => Rho::Intent::START_ACTIVITY,
                    :data       => { :output => Rho::RhoFile.join(Rho::RhoApplication::get_base_app_path(), "#{$logguid}") }
                  }

  Rho::Intent.send(intent_params) # I tried with (url_for: action => :some_callback), but it never gets there because app relaunches and has forgotten all about this by than.
end

The camera app opens fine, but it doesn't return to where it was before the Intent got launched. In stead it just relaunches the app
I know I could create a rhom object and toggle a switch there and point "start_path" to some function to find out where the app was before the Intent, but that looks so sloppy.
...

Am I doing something wrong here ?

Also, the Extra :data section should store the captured image in my specified location according to Android docs MediaStore | Android Developers
but this is failing too

grtz,
gert

Please Register or Login to post a reply

1 Replies

R Robert Galvin

Not sure why the app is relaunhing. Any logs to share? The 'output' needs to be in Android Content URI format it is not just the file path. Best bet is to look at some native Android Uri.fromFile() to see what it provides. It is something like: content://authority/optionalPath/optionalId

CONTACT
Can’t find what you’re looking for?