我是新手尽量写的详细点谢谢
发数据
private void gotoWalletPay() {
Intent intent = new Intent();
intent.setAction("com.haihang.huanlehui.pay.util");
intent.putExtra("price", price);
sendOrderedBroadcast(intent, null);
WalletPayUtils.pay(this);
接收数据
public class WalletPayUtils {
private static String price;
public void onReceive(Context context, Intent intent) {
price=intent.getStringExtra("price");
}
xml文档
<receiver android:name=".WalletPayUtils">
<intent-filter android:priority="1000">
<action android:name="com.haihang.huanlehui.pay.util"/>
</intent-filter>
</receiver>