i'm implementing inapp billing in android app. works well, however, i'm trying decouple broadcast receiver activity manifest. suggestion in android's trivialdrive sample: // important: dynamically register broadcast messages updated purchases. // register receiver here instead of <receiver> in manifest // because call getpurchases() @ startup, therefore can ignore // broadcasts sent while app isn't running. // note: registering listener in activity bad idea, done here // because sample. regardless, receiver must registered after // iabhelper setup, before first call getpurchases(). currently there's class extends broadcastreceiver : public class iabbroadcastreceiver extends broadcastreceiver { /** * intent action receiver should filter for. */ public static final string action = "com.android.vending.billing.purchases_updated"; private final iabbroadcastlistener mlistener; public iabbroadcastreceiver(iabbroadcastlistener listener) { m...
i know more elegant way define string variables included, if want add conditional in pre es6 do.. var = "text"+(conditional?a:b)+" more text" now template literals do.. let a; if(conditional) = `test${a} more text`; else = `test${b} more text`; is there more elegant way implement conditional? possible include if shortcut? use this: let = `test${conditional ? : b} more text`;
Comments
Post a Comment