Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


system("am start ..."); Invalid argument


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 polyfrag   Crossbones+   -  Reputation: 1873

Like
0Likes
Like

Posted 11 April 2013 - 05:48 PM

I tried
 
system("am start -a android.intent.action.MAIN -n com.pathogengame.pathogen/com.pathogengame.pathogen.VideoActivity")
 
and
 
system("am start -n com.pathogengame.pathogen/com.pathogengame.pathogen.VideoActivity")
 
and
 
system("am start -n com.pathogengame.pathogen/.VideoActivity")
 
But it always returns something other than 0 (doesn't work) and strerror(errno) returns either
 

Invalid argument

 
or
 

Try again.

 
How can I natively start another activity?


Sponsor:

#2 frob   Moderators   -  Reputation: 22235

Like
0Likes
Like

Posted 12 April 2013 - 02:03 PM

There's the usual issues:  Does the app have proper permissions?  Does it have the intent filters set up correctly?

 

 

Next, there is the fact that your method is contrary to the whole security design of Android.  Each app gets a private little virtual machine.  Unless specified otherwise, you get one process.  Stray processes can be killed by the OS without notice. Calls to system() cause many such things to potentially happen.  A few moments searching the Android development groups show this random stray-process reaping as the cause of many crashes.

 

The right way to do it is use JNI to start your Intent.  The NDK does not provide a way to do it.  Again per the Android group forums, the dev teams know about the omission from the NDK and have no plans to introduce methods to do it.


Edited by frob, 12 April 2013 - 02:04 PM.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS