Android 支付宝小程序跳转
生活随笔
收集整理的這篇文章主要介紹了
Android 支付宝小程序跳转
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
跳轉(zhuǎn)方法如下(詳細查看-支付寶官網(wǎng)開發(fā)者資料)
/*** 支付寶小程序** @param context 上下文處理* @param appId 小程序appId* @param page 小程序跳轉(zhuǎn)的頁面。如果不設置,默認為跳轉(zhuǎn)至首頁。例如:pages/user/user* @param query 啟動參數(shù),內(nèi)容按照格式為參數(shù)名=參數(shù)值&參數(shù)名=參數(shù)值…之后encode,例如:client_type=2*/public static void start(Context context, String appId, String page, String query) {try {StringBuffer sb = new StringBuffer("alipays://platformapi/startapp?");sb.append("appId=").append(appId).append("&");sb.append("page=").append(page).append("&");String link = URLEncoder.encode(query, "UTF-8");sb.append("query=").append(link);Uri uri = Uri.parse(sb.toString());Intent intent = new Intent(Intent.ACTION_VIEW, uri);context.startActivity(intent);} catch (UnsupportedEncodingException e) {e.printStackTrace();}}總結(jié)
以上是生活随笔為你收集整理的Android 支付宝小程序跳转的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 看了就会的 Node.js 三大基础模块
- 下一篇: android webview 百度地图