小编Abh*_*ood的帖子

使用排球发出GSON请求

我有以下json响应

{
  "tag": [
    {
      "listing_count": 5,
      "listings": [
        {
          "source": "source1",
          "data": {
            "image": "image1",
            "name": "name1"
          },
          "name": "name1"
        }
      ]
    },
    {
      "listing_count": 5,
      "listings": [
        {
          "source": "source2",
          "data": {
            "image": "imag2",
            "name": "name2"
          },
          "name": "name2"
        }
      ]
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我为GSON请求创建了以下类.如何使用排球请求发出GSON请求并存储响应的值.GSON请求应该是什么样的?

public class TagList {

ArrayList<Tag> tags;

public static class Tag {
    int listing_count;
    ArrayList<Listings> listings;

    public int getListing_count() {
        return listing_count;
    }

    public void setListing_count(int listing_count) {
        this.listing_count = listing_count;
    }

    public ArrayList<Listings> …
Run Code Online (Sandbox Code Playgroud)

android json gson android-volley

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

在GridView中设置项目长按侦听器

我想添加一个项目长按一下监听器,它会将选择的图像设置为壁纸.我从网上获取图像并在网格视图中显示它们.我的网格活动如下所示.我已经有一个点击监听器来显示全屏图像.

public class ImageGridActivity extends BaseActivity {

String[] imageUrls;

DisplayImageOptions options;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.ac_image_grid);

    Bundle bundle = getIntent().getExtras();
    imageUrls = bundle.getStringArray(Extra.IMAGES);

    options = new DisplayImageOptions.Builder()
            .showStubImage(R.drawable.stub_image)
            .showImageForEmptyUri(R.drawable.image_for_empty_url)
            .cacheInMemory().cacheOnDisc()
            .bitmapConfig(Bitmap.Config.RGB_565).build();

    GridView gridView = (GridView) findViewById(R.id.gridview);
    gridView.setAdapter(new ImageAdapter());

    // Set Long-Clickable
    gridView.setLongClickable(true);
    gridView.setOnItemLongClickListener(new OnItemLongClickListener() {

        @SuppressLint("NewApi")
        public boolean onItemLongClick(AdapterView<?> parent, View arg1,
                int position, long arg3) {
            // TODO Auto-generated method stub
            ImageAdapter i = (ImageAdapter) parent.getAdapter();
            Bitmap mBitmap = BitmapFactory.decodeResource(getResources(),
                    (int) i.getItemId(position));

            // …
Run Code Online (Sandbox Code Playgroud)

android onitemclicklistener

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

从PNG图像中提取元数据

如何从像这个网站的图像中提取元数据?我使用过exev2库,但与本网站相比,它只提供有限的数据.有更高级的图书馆吗?

我已经尝试过hacoir-metadata Python库.

Windows如何提取图像的细节(我们从属性中看到的)?

php metadata image imagemagick image-processing

2
推荐指数
1
解决办法
752
查看次数