本文整理匯總了Java中android.os.Message.setData方法的典型用法代碼示例。如果您正苦於以下問題:Java Message.setData方法的具體用法?Java Message.setData怎麽用?Java Message.setData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.os.Message
的用法示例。
在下文中一共展示了Message.setData方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: playHapticForPlaybackPosition
import android.os.Message; //導入方法依賴的package包/類
public void playHapticForPlaybackPosition(int i, long j) {
try {
removePlaybackCallbacks();
this.b044E044E044E044E044Eю.removeMessages(2);
try {
Bundle bundle = new Bundle();
bundle.putInt(b044E044Eю044E044Eю, i);
bundle.putLong(bюю044E044E044Eю, j);
if (((b04290429042904290429Щ + b0429ЩЩЩЩ0429) * b04290429042904290429Щ) % bЩ0429ЩЩЩ0429 != bЩЩЩЩЩ0429) {
b04290429042904290429Щ = b04290429ЩЩЩ0429();
bЩЩЩЩЩ0429 = b04290429ЩЩЩ0429();
}
Message obtainMessage = this.b044E044E044E044E044Eю.obtainMessage(2);
obtainMessage.setData(bundle);
this.b044E044E044E044E044Eю.sendMessage(obtainMessage);
} catch (Exception e) {
throw e;
}
} catch (Exception e2) {
throw e2;
}
}
示例2: connectionLost
import android.os.Message; //導入方法依賴的package包/類
/**
* Indicate that the connection was lost and notify the UI Activity.
*/
private void connectionLost() {
// Send a failure message back to the Activity
Message msg = mHandler.obtainMessage(Constants.MESSAGE_TOAST);
Bundle bundle = new Bundle();
bundle.putString(Constants.TOAST, CONNECTION_LOST_MSG);
msg.setData(bundle);
mHandler.sendMessage(msg);
mState = STATE_NONE;
// Update UI title
updateUserInterfaceTitle();
// Start the service over to restart listening mode
BluetoothListener.this.start();
}
示例3: RunNewGetInverse
import android.os.Message; //導入方法依賴的package包/類
public void RunNewGetInverse(final int pos, final ProgressDialog pq) {
Runnable runnable = new Runnable() {
@Override
public void run() {
Matrix res = SquareList.get(pos).Inverse(pq);
Message message = new Message();
if (res != null) {
message.setData(res.GetDataBundled());
myHandler.sendMessage(message);
} else {
myHandler.postDelayed(new Runnable() {
@Override
public void run() {
Toast.makeText(getContext(), R.string.NoInverse, Toast.LENGTH_SHORT).show();
}
}, 0);
pq.dismiss();
}
}
};
Thread thread = new Thread(runnable);
thread.start();
}
示例4: RunToGetDeterminant
import android.os.Message; //導入方法依賴的package包/類
public void RunToGetDeterminant(final int pos, final ProgressDialog px) {
Runnable runnable = new Runnable() {
@Override
public void run() {
double var = SquareList.get(pos).GetDeterminant(px);
Message message = new Message();
Bundle bundle = new Bundle();
bundle.putDouble("RESULTANT", var);
message.setData(bundle);
px.dismiss();
myhandler.sendMessage(message);
}
};
Thread thread = new Thread(runnable);
thread.start();
}
示例5: notifyMidAdStartToAdSdk
import android.os.Message; //導入方法依賴的package包/類
public void notifyMidAdStartToAdSdk() {
if (this.mActivity.getFlow() != null && this.mActivity.getFlow().mIsMidAdFinished) {
LogInfo.log("zhaosumin", "中貼廣告開始");
if (this.mActivity.getHalfFragment() != null) {
this.mActivity.getVideoController().setVisibilityForMore(false);
this.mActivity.getHalfFragment().closeExpand();
}
this.mActivity.getFlow().mIsMidAdFinished = false;
reSet();
this.mActivity.getVideoController().setControllerVisibility(8, true);
setVisibleForBarrage(false);
Message msg = new Message();
msg.what = 10;
Bundle bundle = new Bundle();
bundle.putInt(ClientCPConstant.KEY_AD_TYPE, 2);
msg.setData(bundle);
this.mActivity.getPlayAdListener().notifyADEvent(msg);
this.mActivity.getAlbumPlayFragment().setVisibityForWaterMark(false);
}
}
示例6: sendRequest
import android.os.Message; //導入方法依賴的package包/類
private void sendRequest(int what, Bundle data) throws RemoteException {
Message msg = Message.obtain();
msg.what = what;
msg.arg1 = 1;
msg.setData(data);
this.mCallbacks.send(msg);
}
示例7: onNewDevice
import android.os.Message; //導入方法依賴的package包/類
public void onNewDevice(short devAddr, byte[] uuid) {
Message msg = new Message();
Bundle bundle = new Bundle();
bundle.putByte(MESH_EVT_MSG_PAR_KEY_EVENT, MESH_EVENT_ON_NEW_DEVICE);
bundle.putShort(MESH_EVT_MSG_PAR_KEY_DEVADDR, devAddr);
bundle.putByteArray(MESH_EVT_MSG_PAR_KEY_UUID, uuid);
msg.setData(bundle);
mEvtHdl.sendMessage(msg);
}
示例8: send
import android.os.Message; //導入方法依賴的package包/類
private void send(int method, Bundle params) {
Message m = Message.obtain(null, method);
m.setData(params);
try {
mServiceMessenger.send(m);
} catch (RemoteException e) {
e.printStackTrace();
}
}
示例9: response
import android.os.Message; //導入方法依賴的package包/類
protected void response(String error) {
try {
Message msg = Message.obtain(null, message);
if (error != null) {
Bundle bundle = new Bundle();
bundle.putString(BUNDLE_KEY_ERROR, error);
msg.setData(bundle);
}
thiz.client.send(msg);
} catch (RemoteException e) {
e.printStackTrace();
}
}
示例10: visualUpdate
import android.os.Message; //導入方法依賴的package包/類
private void visualUpdate(int action, String text) {
Message msg = mHandler.obtainMessage();
Bundle bundle = new Bundle();
bundle.putInt(TestHandler.ACTION, action);
bundle.putString(TestHandler.TEXT, text);
msg.setData(bundle);
mHandler.sendMessage(msg);
}
示例11: registerEater
import android.os.Message; //導入方法依賴的package包/類
public void registerEater(String action,IEater eater){
if (action == null || eater == null){
throw new RuntimeException("parameters can not be null action = "+action+" , eater = "+eater);
}
Message msg = new Message();
msg.what = MSG_REGISTER;
msg.obj = eater;
Bundle ac = new Bundle();
ac.putString("action",action);
msg.setData(ac);
mHandler.sendMessage(msg);
}
示例12: onNetCreated
import android.os.Message; //導入方法依賴的package包/類
public void onNetCreated() {
Message msg = new Message();
Bundle bundle = new Bundle();
bundle.putByte(MESH_EVT_MSG_PAR_KEY_EVENT, MESH_EVENT_ON_NET_CREATED);
msg.setData(bundle);
mEvtHdl.sendMessage(msg);
}
示例13: connectionLost
import android.os.Message; //導入方法依賴的package包/類
/**
* Indicate that the connection was lost and notify the UI Activity.
*/
private void connectionLost()
{
// Send a failure message back to the Activity
Message msg = mHandler.obtainMessage(MainActivity.MESSAGE_TOAST);
Bundle bundle = new Bundle();
bundle.putString(MainActivity.TOAST, "Se ha perdido la conexión del dispositivo");
msg.setData(bundle);
mHandler.sendMessage(msg);
// Start the service over to restart listening mode
BluetoothIOGateway.this.start();
}
示例14: handleMessage
import android.os.Message; //導入方法依賴的package包/類
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == RECEIVE_MESSAGE_CODE) {
Log.i(TAG, "PedometerService serviceHandler");
Bundle data = msg.getData();
if (data != null) {
TAG_STEP = data.getInt("TAG_STEP");
if (mPedometerCore != null) {
}
}
if (mClientMessenger == null) {
mClientMessenger = msg.replyTo;//這個Message是在客戶端中創建的
}
if (mClientMessenger != null && mPedometerEntity != null) {
Message msgToClient = Message.obtain();
msgToClient.what = SEND_MESSAGE_CODE;
Bundle bundle = new Bundle();
bundle.putSerializable("msg", mPedometerEntity);
msgToClient.setData(bundle);
try {
mClientMessenger.send(msgToClient);
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
}
示例15: send
import android.os.Message; //導入方法依賴的package包/類
/**
* send the {@link Message} to the Actor that started this chain of calls
*
* @throws ActorMessagingException if the operation failed
*/
public void send() throws ActorMessagingException {
Message newMessage = Message.obtain();
newMessage.what = ActorsIntegrationService.SEND_MESSAGE;
newMessage.obj = message;
newMessage.setData(bundle(address));
try {
actorServiceMessenger.send(newMessage);
} catch (Throwable e) {
throw new ActorMessagingException(e);
}
}