當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。