本文整理匯總了Java中android.os.Bundle.putByteArray方法的典型用法代碼示例。如果您正苦於以下問題:Java Bundle.putByteArray方法的具體用法?Java Bundle.putByteArray怎麽用?Java Bundle.putByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.putByteArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: bundleThumbnail
import android.os.Bundle; //導入方法依賴的package包/類
private static void bundleThumbnail(PlanarYUVLuminanceSource source, Bundle bundle) {
int[] pixels = source.renderThumbnail();
int width = source.getThumbnailWidth();
int height = source.getThumbnailHeight();
Bitmap bitmap = Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.ARGB_8888);
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, out);
bundle.putByteArray(DecodeThread.BARCODE_BITMAP, out.toByteArray());
bundle.putFloat(DecodeThread.BARCODE_SCALED_FACTOR, (float) width / source.getWidth());
}
示例2: licensePressed
import android.os.Bundle; //導入方法依賴的package包/類
@OnClick(R.id.license_image)
void licensePressed() {
final Intent intent = new Intent(this, PictureZoomActivity.class);
final Bundle extras = new Bundle();
extras.putByteArray("picture", licence.getPhoto());
intent.putExtras(extras);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, headshot, "zoom");
startActivity(intent, options.toBundle());
}
示例3: setAvator
import android.os.Bundle; //導入方法依賴的package包/類
public void setAvator(Bitmap bitmap, IUiListener iUiListener) {
Bundle composeCGIParams = composeCGIParams();
OutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(CompressFormat.JPEG, 40, byteArrayOutputStream);
byte[] toByteArray = byteArrayOutputStream.toByteArray();
bitmap.recycle();
IRequestListener tempRequestListener = new TempRequestListener(iUiListener);
composeCGIParams.putByteArray(SocialConstants.PARAM_AVATAR_URI, toByteArray);
HttpUtils.requestAsync(this.mToken, Global.getContext(), "user/set_user_face", composeCGIParams, "POST", tempRequestListener);
d.a().a(this.mToken.getOpenId(), this.mToken.getAppId(), Constants.VIA_SET_AVATAR_SUCCEED, "12", "19", "0");
}
示例4: onNewDevice
import android.os.Bundle; //導入方法依賴的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);
}
示例5: regResponseMsgListener
import android.os.Bundle; //導入方法依賴的package包/類
/**
* 注冊監聽響應的msg.
*
* @param context c
* @param msgListenerKey listerId 用於在map中標識監聽器
* @param handler 用於回傳響應的數據
* @param sendBothwayId 發送時的BothwayId.
*/
private static void regResponseMsgListener(
final Context context, final long msgListenerKey,
@NonNull final Handler handler, @NonNull final byte[] sendBothwayId) {
WTResponseMsgListener listener = new WTResponseMsgListener() {
@Override
public void onResponseMsgReceived(String path, byte[] data, byte[] bothwayId) {
//判斷與發送時的path是否對應,避免同時發送2個請求時響應混亂。
if (!Arrays.equals(sendBothwayId, bothwayId)) return;
//雙向通訊響應path格式為:/RE/WTBothway/{nanoTime}/xxx
Message msg = handler.obtainMessage(HANDLER_RECEIVE_RESPONSE);
Bundle bundle = new Bundle();
bundle.putByteArray("data", data);
bundle.putString("path", path);
msg.setData(bundle);
handler.sendMessage(msg);
if (msgListenerMap.get(msgListenerKey) != null) {
WTLog.v(TAG, "Remove response msg listener.");
WTRegister.removeMessageListener(context, msgListenerMap.get(msgListenerKey));
msgListenerMap.remove(msgListenerKey);
}
}
};
WTLog.v(TAG, "Register response msg listener.");
msgListenerMap.put(msgListenerKey, listener);
WTRegister.addMessageListener(context, listener);
}
示例6: bundleThumbnail
import android.os.Bundle; //導入方法依賴的package包/類
private static void bundleThumbnail(PlanarYUVLuminanceSource source, Bundle bundle) {
int[] pixels = source.renderThumbnail();
int width = source.getThumbnailWidth();
int height = source.getThumbnailHeight();
Bitmap bitmap = Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.ARGB_8888);
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, out);
bundle.putByteArray(DecodeThread.BARCODE_BITMAP, out.toByteArray());
bundle.putFloat(DecodeThread.BARCODE_SCALED_FACTOR, (float) width / source.getWidth());
}
示例7: newInstance
import android.os.Bundle; //導入方法依賴的package包/類
public static ShareForumFragment newInstance(GroupId groupId) {
Bundle args = new Bundle();
args.putByteArray(GROUP_ID, groupId.getBytes());
ShareForumFragment fragment = new ShareForumFragment();
fragment.setArguments(args);
return fragment;
}
示例8: bundleThumbnail
import android.os.Bundle; //導入方法依賴的package包/類
/**
* create thumbnail
*
* @param source
* @param bundle
*/
private void bundleThumbnail(PlanarYUVLuminanceSource source, Bundle bundle) {
int[] pixels = source.renderThumbnail();
int width = source.getThumbnailWidth();
int height = source.getThumbnailHeight();
Bitmap bitmap = Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.RGB_565);
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, out);
bundle.putByteArray(DecodeThread.BARCODE_BITMAP, out.toByteArray());
}
示例9: onSaveInstanceState
import android.os.Bundle; //導入方法依賴的package包/類
public void onSaveInstanceState(Bundle outState) {
Parcel outParcel = Parcel.obtain();
outParcel.writeSparseBooleanArray(mCheckStates);
final int numStates = mCheckedIdStates.size();
outParcel.writeInt(numStates);
for (int i=0; i<numStates; i++) {
outParcel.writeLong(mCheckedIdStates.keyAt(i));
outParcel.writeInt(mCheckedIdStates.valueAt(i));
}
byte[] states = outParcel.marshall();
outState.putByteArray(SELECTED_ITEMS_KEY, states);
outParcel.recycle();
}
示例10: newInstance
import android.os.Bundle; //導入方法依賴的package包/類
public static RevealContactsFragment newInstance(GroupId groupId) {
Bundle args = new Bundle();
args.putByteArray(GROUP_ID, groupId.getBytes());
RevealContactsFragment fragment = new RevealContactsFragment();
fragment.setArguments(args);
return fragment;
}
示例11: onSaveInstanceState
import android.os.Bundle; //導入方法依賴的package包/類
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
ThreadItem replyItem = adapter.getHighlightedItem();
if (replyItem != null) {
outState.putByteArray(KEY_REPLY_ID, replyItem.getId().getBytes());
}
}
示例12: newInstance
import android.os.Bundle; //導入方法依賴的package包/類
public static GroupInviteFragment newInstance(GroupId groupId) {
Bundle args = new Bundle();
args.putByteArray(GROUP_ID, groupId.getBytes());
GroupInviteFragment fragment = new GroupInviteFragment();
fragment.setArguments(args);
return fragment;
}
示例13: bundleThumbnail
import android.os.Bundle; //導入方法依賴的package包/類
private static void bundleThumbnail(PlanarYUVLuminanceSource source, Bundle bundle) {
int[] pixels = source.renderThumbnail();
int width = source.getThumbnailWidth();
int height = source.getThumbnailHeight();
Bitmap bitmap = Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.ARGB_8888);
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, out);
bundle.putByteArray(DecodeThread.BARCODE_BITMAP, out.toByteArray());
}
示例14: onSaveInstanceState
import android.os.Bundle; //導入方法依賴的package包/類
@Override
public void onSaveInstanceState(Bundle state) {
super.onSaveInstanceState(state);
if (localAuthorId != null) {
byte[] b = localAuthorId.getBytes();
state.putByteArray("briar.LOCAL_AUTHOR_ID", b);
}
state.putInt("briar.LOCAL_CODE", localInvitationCode);
state.putInt("briar.REMOTE_CODE", remoteInvitationCode);
state.putBoolean("briar.FAILED", connectionFailed);
state.putString("briar.CONTACT_NAME", contactName);
if (task != null) state.putLong("briar.TASK_HANDLE", taskHandle);
}
示例15: saveInstanceState
import android.os.Bundle; //導入方法依賴的package包/類
private void saveInstanceState(final Bundle outState) {
outState.putByteArray("receive_address", address.getHash160());
}