本文整理汇总了Java中android.app.RemoteInput.addResultsToIntent方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteInput.addResultsToIntent方法的具体用法?Java RemoteInput.addResultsToIntent怎么用?Java RemoteInput.addResultsToIntent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.RemoteInput
的用法示例。
在下文中一共展示了RemoteInput.addResultsToIntent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import android.app.RemoteInput; //导入方法依赖的package包/类
public static void send(String room, String message) throws IllegalArgumentException { // @author ManDongI
Notification.Action session = null;
for(KakaoData data : KakaoManager.getInstance().getDataList().toArray(new KakaoData[0])) {
if(data.room.equals(room)) {
session = data.session;
break;
}
}
if(session == null) {
throw new IllegalArgumentException("Can't find the room");
}
Intent sendIntent = new Intent();
Bundle msg = new Bundle();
for (RemoteInput inputable : session.getRemoteInputs()) msg.putCharSequence(inputable.getResultKey(), message);
RemoteInput.addResultsToIntent(session.getRemoteInputs(), sendIntent, msg);
try {
session.actionIntent.send(context, 0, sendIntent);
Logger.Log log = new Logger.Log();
log.type = Logger.Type.APP;
log.title = "send message";
log.index = "room: " + room +"\nmessage: " + message;
Logger.getInstance().add(log);
} catch (PendingIntent.CanceledException e) {
e.printStackTrace();
}
}
示例2: send
import android.app.RemoteInput; //导入方法依赖的package包/类
public static void send(String room, String message) throws IllegalArgumentException { // @author ManDongI
Notification.Action session = null;
for(Session i : sessions) {
if(i.room.equals(room)) {
session = i.session;
break;
}
}
if(session == null) {
throw new IllegalArgumentException("Can't find the room");
}
Intent sendIntent = new Intent();
Bundle msg = new Bundle();
for (RemoteInput inputable : session.getRemoteInputs()) msg.putCharSequence(inputable.getResultKey(), message);
RemoteInput.addResultsToIntent(session.getRemoteInputs(), sendIntent, msg);
try {
session.actionIntent.send(context, 0, sendIntent);
} catch (PendingIntent.CanceledException e) {
e.printStackTrace();
}
}
示例3: addResultsToIntent
import android.app.RemoteInput; //导入方法依赖的package包/类
static void addResultsToIntent(RemoteInputCompatBase.RemoteInput[] remoteInputs,
Intent intent, Bundle results) {
RemoteInput.addResultsToIntent(fromCompat(remoteInputs), intent, results);
}
示例4: addResultsToIntent
import android.app.RemoteInput; //导入方法依赖的package包/类
static void addResultsToIntent(RemoteInputCompatBase.RemoteInput aremoteinput[], Intent intent, Bundle bundle)
{
RemoteInput.addResultsToIntent(fromCompat(aremoteinput), intent, bundle);
}