我在下面的循环中获取 URL 字符串
referrer = intent.getStringExtra("referrer");
以下是日志
action: 'com.android.vending.INSTALL_REFERRER' referrer string: 'utm_source=tooyoou&utm_medium=banner&utm_term=foursquare&utm_content=foursquare-tooyoou&utm_campaign=foursquare'
我想解析这个 URL 字符串并得到下面的字符串 "utm_source" "utm_medium" "utm_term" "utm_content" "utm_campaign"
我尝试了下面的代码,但得到了 null
Uri referrerUri = Uri.parse(referrer);
String utmsource= referrerUri.getQueryParameter("utm_source");
String utmmedium= referrerUri.getQueryParameter("utm_medium");
String utmterm= referrerUri.getQueryParameter("utm_term");
String utmcontent= referrerUri.getQueryParameter("utm_content");
String utmcampaign= referrerUri.getQueryParameter("utm_campaign");
Log.d("utmsource===" , utmsource);
Log.d("utmmedium===" , utmmedium);
Log.d("utmterm===" , utmterm);
Log.d("utmcontent===" , utmcontent);
Log.d("utmcampaign===" , utmcampaign);
可能是什么问题呢 ?