当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.putByteArray方法代码示例

本文整理汇总了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());
}
 
开发者ID:Zmingxu,项目名称:ZxingScanner,代码行数:11,代码来源:DecodeHandler.java

示例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());
}
 
开发者ID:mDL-ILP,项目名称:mDL-ILP,代码行数:12,代码来源:ViewLicenseActivity.java

示例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");
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:ImageActivity.java

示例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);
}
 
开发者ID:blxble,项目名称:mesh-core-on-android,代码行数:10,代码来源:MeshService.java

示例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);
}
 
开发者ID:liangchenhe55,项目名称:WearTools,代码行数:36,代码来源:WTBothway.java

示例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());
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:11,代码来源:DecodeHandler.java

示例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;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:8,代码来源:ShareForumFragment.java

示例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());
}
 
开发者ID:snice,项目名称:androidscan,代码行数:17,代码来源:DecodeHandler.java

示例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();
}
 
开发者ID:changja88,项目名称:Udacity_Sunshine,代码行数:14,代码来源:ItemChoiceManager.java

示例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;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:8,代码来源:RevealContactsFragment.java

示例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());
	}
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:9,代码来源:ThreadListActivity.java

示例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;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:8,代码来源:GroupInviteFragment.java

示例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());
}
 
开发者ID:WindFromFarEast,项目名称:SmartButler,代码行数:10,代码来源:DecodeHandler.java

示例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);
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:14,代码来源:AddContactActivity.java

示例15: saveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
private void saveInstanceState(final Bundle outState) {
    outState.putByteArray("receive_address", address.getHash160());
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:4,代码来源:RequestCoinsFragment.java


注:本文中的android.os.Bundle.putByteArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。