I just want to have a button link to an external site, so that when clicked it opens up Safari and goes to the specified URL.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
How do you open Safari?
Yep i want the exact same thing for a client i'm making an app for not sure how to do it either.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | local function testNetworkConnection() local netConn = require('socket').connect('www.apple.com', 80) if netConn == nil then return false end netConn:close() return true end local DEVICE = system.getInfo ( "environment" ) local AppURL = "http://url.of.your.choice/" if DEVICE == "simulator" then print ( "Cannot spawn this URL in the simulator" ) else if testNetworkConnection() then system.openURL ( AppURL ) end end |
http://developer.anscamobile.com/reference/index/systemopenurl
@robmiracle, why do you need to do all those checks for network connection or simulator environment? I just used a single line (system.openURL("http://www.website.com") and it works fine even in the simulator. Is this just used to make your app more user friendly so you can return a "not connected" type message?
Because it was in the code I stole.. er. borrowed from.
Its basically good practice, as you said, so you can let the user know whats going on.
thanks, this works.
views:1511 update:2011/9/28 9:01:40
热门文章
GameCenter LeaderBoards and Achievements Enabled Through OpenFeint
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
相关文章
Amazon refuse to mark my app as Kindle Fire compatible
Splish in Review
Big Android BBQ in Austin Texas
Application exits on relaunch , but then launches fine again.
Back Button for WebPopup
3g location instead og GPS
widget.newTableView() malfunctioning on Windows iPad simulator.
validating corona built apks with Motorola App Validator
Help with shooting bullets
Feature Requests
Splish in Review
Big Android BBQ in Austin Texas
Application exits on relaunch , but then launches fine again.
Back Button for WebPopup
3g location instead og GPS
widget.newTableView() malfunctioning on Windows iPad simulator.
validating corona built apks with Motorola App Validator
Help with shooting bullets
Feature Requests
corona forums © 2003-2011