本文整理了Java中android.os.Bundle.putByteArray()
方法的一些代码示例,展示了Bundle.putByteArray()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.putByteArray()
方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:putByteArray
暂无
代码示例来源:origin: stackoverflow.com
Bundle param = new Bundle();
param.putString("message", "picture caption");
param.putByteArray("picture", ImageBytes);
mAsyncRunner.request("me/photos", param, "POST", new SampleUploadListener());
代码示例来源:origin: facebook/facebook-android-sdk
@Override
public Bundle getParameters()
throws IOException {
Bundle parameters = new Bundle();
parameters.putString(PARAM_UPLOAD_PHASE, PARAM_VALUE_UPLOAD_TRANSFER_PHASE);
parameters.putString(PARAM_SESSION_ID, uploadContext.sessionId);
parameters.putString(PARAM_START_OFFSET, chunkStart);
byte[] chunk = getChunk(uploadContext, chunkStart, chunkEnd);
if (chunk != null) {
parameters.putByteArray(PARAM_VIDEO_FILE_CHUNK, chunk);
} else {
throw new FacebookException("Error reading video");
}
return parameters;
}
代码示例来源:origin: stackoverflow.com
byte[] data = null;
String dataPath = "/mnt/sdcard/KaraokeVideos/myvideo.3gp";
String dataMsg = "Your video description here.";
Bundle param;
facebook = new Facebook(FB_APP_ID);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
InputStream is = null;
try {
is = new FileInputStream(dataPath);
data = readBytes(is);
param = new Bundle();
param.putString("message", dataMsg);
param.putString("filename", dataName);
param.putByteArray("video", data);
mAsyncRunner.request("me/videos", param, "POST", new fbRequestListener(), null);
}
catch (FileNotFoundException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
代码示例来源:origin: stackoverflow.com
Bundle params = new Bundle();
params.putByteArray("message", "Test".getBytes());
params.putByteArray("name", "American Virgin".getBytes());
params.putByteArray("link", "http://bit.ly/12345".getBytes());
params.putByteArray("description", "A Freshman College Girl on a scholarship from an ...".getBytes());
params.putByteArray("picture", "http://xxx/MOV1026.jpg".getBytes());
mAsyncRunner.request("me/feed", params, "POST", new TestRequestListener());
代码示例来源:origin: stackoverflow.com
byte[] data = null;
Bitmap bi = BitmapFactory.decodeFile(photoToPost);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();
Bundle params = new Bundle();
params.putString("method", "photos.upload");
params.putByteArray("picture", data);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
mAsyncRunner.request(null, params, "POST", new SampleUploadListener(), null);
代码示例来源:origin: xiaoxiaogogo/Qiaoba
public Builder withByteArray(String key, byte[] val){
if(mArgBundle == null){
mArgBundle = new Bundle();
}
mArgBundle.putByteArray(key, val);
return this;
}
代码示例来源:origin: xiaoxiaogogo/Qiaoba
public Builder withByteArray(String key, byte[] val){
if(mArgBundle == null){
mArgBundle = new Bundle();
}
mArgBundle.putByteArray(key, val);
return this;
}
代码示例来源:origin: stackoverflow.com
Bundle params = new Bundle();
params.putByteArray("photo", data);
params.putString("caption", "Test photo upload");
mAsyncRunner.request("me/photos", params, "POST",
new PhotoUploadListener(), null);
代码示例来源:origin: stackoverflow.com
Bundle params = new Bundle();
params.putByteArray("file", data);
Request request = new Request(
Session.getActiveSession(),
"me/staging_resources",
params,
HttpMethod.POST
);
Response response = request.executeAndWait();
// handle the response
代码示例来源:origin: stackoverflow.com
// facebook being either Facebook or AsyncFacebookRunner
Bundle parameters = new Bundle();
parameters.putString("message", "MESSAGE TO GO WITH THE IMAGE");
parameters.putByteArray("source", imageBytes);
facebook.request("me/photos", parameters, "POST");
代码示例来源:origin: stackoverflow.com
private void postOnWall() {
Bundle params = new Bundle();
params.putString("message", "New picture");
params.putByteArray("source", byteArray);
mAsyncRunner.request("me/photos", params, "POST", new SampleUploadListener(), null);
}
代码示例来源:origin: stackoverflow.com
private void postOnWall() {
Bundle params = new Bundle();
params.putString("message", "New picture");
params.putByteArray("source", byteArray);
Log.d("Facebook-Example", mAsyncRunner == null ? "mAsyncRunner is null" : "mAsyncRunner not null");
mAsyncRunner.request("me/photos", params, "POST", new SampleUploadListener(), null);
}
代码示例来源:origin: stackoverflow.com
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
byte[] bytes = baos.toByteArray();
Bundle bundle = new Bundle();
bundle.putByteArray("Bytes", bytes);
代码示例来源:origin: stackoverflow.com
byte[] data = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bmpImageGallery.compress(CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();
Bundle postImgGallery = new Bundle();
// ADD THE PHOTO DATA TO THE BUNDLE
postImgGallery.putByteArray("photo", data);
代码示例来源:origin: stackoverflow.com
Bundle params = new Bundle();
try
{
params.putByteArray("photo",Utility.scaleImage(getApplicationContext(), photoUri));
}
catch (IOException e)
{
e.printStackTrace();
}
params.putString("caption", "Through My Android Application");
Utility.mAsyncRunner.request("me/photos", params, "POST",new PhotoUploadListener(), null);
代码示例来源:origin: stackoverflow.com
byte[] data = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Bitmap bmpImageCamera.compress(CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();
Bundle postImgGallery = new Bundle();
// ADD THE PHOTO DATA TO THE BUNDLE
postImgGallery.putByteArray("photo", data);
代码示例来源:origin: stackoverflow.com
Intent i = new Intent(current_activity.this, Next_Activity.class);
Bundle bundle = new Bundle();
bundle.putByteArray("photo", photo); // photo is an byte array you already stored data in it
i.putExtras(bundle);
startActivity(i);
代码示例来源:origin: stackoverflow.com
Bundle parameters = new Bundle();
parameters.putString("message","YOUR_MESSAGE");
parameters.putString("caption","ANY_CAPTION");
parameters.putByteArray("picture", "IMAGE_LINK");
String response = facebook.request("me/photos", parameters,
"POST");
代码示例来源:origin: stackoverflow.com
Intent intent = new Intent(myListActivity., ImageActivity.class);
Bundle bundle = new Bundle();
bundle.putByteArray("image", imageArray);
intent.putExtras(bundle);
startActivity(intent);
代码示例来源:origin: stackoverflow.com
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
Bundle b = new Bundle();
b.putByteArray("image",byteArray);
// your fragment code
fragment.setArguments(b);
内容来源于网络,如有侵权,请联系作者删除!