小编Lad*_*ari的帖子

Facebook SharePhotoContent的Android共享图片网址

我正在尝试使用新的SDK中的Facebook新的SharePhoto和SharePhotoContent类共享照片.我想使用图像URL而不是本地存储的图像.

我可以使用本地存储的可绘制资源共享图像:

Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.carrots);

SharePhoto photo = new SharePhoto.Builder()
                   .setImageBitmap(image)
                   .build();

SharePhotoContent content = new SharePhotoContent.Builder()
                                .addPhoto(photo)
                                .build();

shareDialog.show(content);
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用图片网址时:

SharePhoto photo = new SharePhoto.Builder()
                       .setImageUrl(Uri.parse("http://s3-ak.buzzfed.com/static/images/public/verticals/food-title.png?v=201504021353"))
                       .build();
Run Code Online (Sandbox Code Playgroud)

我所看到的只是Facebook shareDialog中的空白帖子.

有没有其他人尝试过这个并让它发挥作用?

非常感谢!

android facebook android-sharing facebook-sdk-4.0

8
推荐指数
1
解决办法
1万
查看次数

C++:从命令行读取文件名并在我的文件中使用它

如何从命令行读取文件名并在我的c ++代码文件中使用它?

例如:./ cppfile inputFilename outputFilename

任何帮助是极大的赞赏!

c++ file

3
推荐指数
1
解决办法
1万
查看次数

未在此范围内声明

我正在实现MIPS指令集模拟器.但是当我尝试编译我的代码时,我不断遇到"超出范围"的错误,而且它变得非常令人沮丧.我尝试了各种各样的变化,但似乎没有任何帮助.
这是我的MIPSsim.cpp文件

#include <iostream>
#include <fstream>
#include <string>
#include <cassert>

using namespace std;
const int BITS = 32;

string inst_decode(string line);
void execute(string line, string instruction, int &registers[]);
void print(int cycle, int inst_address, int regs[]/*, int data[]*/);
int convert_5(string binary);
int convert_32(string binary);
void add(string line, int &registers[]);
void sub(string line, int &registers[]);
void mult(string line, int &registers[]);


string inst_decode(string line){
    string instruction; 
    if(line.compare(0,1,"0") == 0){
        if (line.compare(1,5,"00010") == 0){
            cout << "JUMP" << endl;
            instruction = "JUMP";
        }else if …
Run Code Online (Sandbox Code Playgroud)

c++ linux scope out

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×2

android ×1

android-sharing ×1

facebook ×1

facebook-sdk-4.0 ×1

file ×1

linux ×1

out ×1

scope ×1