参考此链接open a url on click of ok button in android
我想通过构建器按钮在我的xampp服务器中调用php函数,单击“确定”
答案 0 :(得分:1)
Uri uri = Uri.parse("10.0.2.2/sth.php?runFunction=true");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
PHP:
<?php
if($_GET["runFunction"] == true){
myFunction();
}
function myFunction(){
...
}
?>