本文整理了Java中android.os.Message.peekData()
方法的一些代码示例,展示了Message.peekData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.peekData()
方法的具体详情如下:
包路径:android.os.Message
类名称:Message
方法名:peekData
暂无
代码示例来源:origin: robolectric/robolectric
@Test
public void testPeekData() throws Exception {
assertThat(new Message().peekData()).isNull();
Message m = new Message();
Bundle b = new Bundle();
m.setData(b);
assertThat(m.peekData()).isEqualTo(b);
}
代码示例来源:origin: google/samba-documents-provider
private Message obtainMessageForOpenFile(
String uri, String mode, MessageValues<SambaFile> messageValues) {
final Message msg = obtainMessage(OPEN_FILE, messageValues, uri);
msg.peekData().putString(MODE, mode);
return msg;
}
代码示例来源:origin: google/samba-documents-provider
@Override
void processMessage(Message msg) {
final Bundle args = msg.peekData();
final String uri = args.getString(URI_KEY);
switch (msg.what) {
case PUT_CREDENTIAL: {
final String workgroup = args.getString(WORKGROUP_KEY);
final String username = args.getString(USERNAME_KEY);
final String password = args.getString(PASSWORD_KEY);
mCredentialCacheImpl.putCredential(uri, workgroup, username, password);
break;
}
case REMOVE_CREDENTIAL: {
mCredentialCacheImpl.removeCredential(uri);
break;
}
default:
throw new UnsupportedOperationException("Unknown operation " + msg.what);
}
}
}
代码示例来源:origin: wiglenet/wigle-wifi-wardriving
@Override
public void handleMessage( final Message msg ) {
if ( fired ) {
return;
}
fired = true;
final Bundle bundle = msg.peekData();
String error = "unknown";
if ( bundle == null ) {
MainActivity.error("no bundle in msg: " + msg);
}
else {
error = bundle.getString( ERROR );
}
final MainActivity mainActivity = MainActivity.getMainActivity();
final Intent errorReportIntent = new Intent( mainActivity, ErrorReportActivity.class );
errorReportIntent.putExtra( ERROR_REPORT_DIALOG, error );
mainActivity.startActivity( errorReportIntent );
}
}
代码示例来源:origin: wiglenet/wigle-wifi-wardriving
public static BackgroundAlertDialog newInstance( final Message msg, final Status status ) {
final BackgroundAlertDialog frag = new BackgroundAlertDialog();
Bundle args = msg.peekData();
args.putInt("title", status.getTitle());
args.putInt("message", status.getMessage());
args.putInt("status", status.ordinal());
frag.setArguments(args);
return frag;
}
代码示例来源:origin: google/samba-documents-provider
@Override
public void rename(String uri, String newUri) throws IOException {
try (final MessageValues<?> messageValues = MessageValues.obtain()) {
final Message msg = obtainMessage(RENAME, messageValues, uri);
msg.peekData().putString(NEW_URI, newUri);
enqueue(msg);
messageValues.checkException();
}
}
代码示例来源:origin: google/samba-documents-provider
@Override
@SuppressWarnings("unchecked")
public void processMessage(Message msg) {
final Bundle args = msg.peekData();
final String uri = args.getString(URI);
final MessageValues messageValues = (MessageValues) msg.obj;
代码示例来源:origin: wiglenet/wigle-wifi-wardriving
composeDisplayMessage(context, msg.peekData().getString( ERROR ),
msg.peekData().getString( FILEPATH ), msg.peekData().getString( FILENAME ),
status.getMessage()));
} else {
内容来源于网络,如有侵权,请联系作者删除!