Android Wear Remote Voice Input to Main Action Intent -
i'm playing around android wear according documentation google provided (http://developer.android.com/wear/notifications/remote-input.html) stuck in part i'm missing something. can guys out? here's code.
intent viewintent = new intent(this, actionactivity.class); viewintent.putextra(getstring(r.string.extrastringtag), extrastring); pendingintent viewpendingintent = pendingintent.getactivity(this, 0, viewintent, 0); intent mapintent = new intent(intent.action_view); uri geouri = uri.parse("geo:0,0?q=" + uri.encode(location)); mapintent.setdata(geouri); pendingintent mappendingintent = pendingintent.getactivity(this, 0, mapintent, 0); bigtextstyle bigstyle = new notificationcompat.bigtextstyle(); bigstyle.bigtext(eventdescription); string[] replychoices = getresources().getstringarray(r.array.reply_choices); remoteinput remoteinput = new remoteinput.builder(getstring(r.string.extrastringtag)) .setlabel(replytitle) .setchoices(replychoices) .build(); notificationcompat.builder notificationbuilder = new notificationcompat.builder(this) .setsmallicon(r.drawable.questionblock) .setlargeicon(bitmapfactory.decoderesource( getresources(), r.drawable.mariopagebg)) .setstyle(bigstyle) .setcontenttitle(eventtitle) .setcontenttext(eventdescription) .setcontentintent(viewpendingintent) .addaction(r.drawable.mariomap, mapstring, mappendingintent); notification notification = new wearablenotifications.builder(notificationbuilder) .addremoteinputforcontentintent(remoteinput) .build(); // instance of notificationmanager service notificationmanagercompat notificationmanager = notificationmanagercompat.from(this); // build notification , issues notification manager. notificationmanager.notify(notificationid, notification);
as declared in documentation, primary action button not converted "reply" should be.
i fixed problem adding activity manifest. honest mistake. playing android wear, keep in mind pending activities in code block did not add manifest won't crash application. there won't 'missing class declaration' in stack trace.
Comments
Post a Comment