小编Tas*_*tor的帖子

Android gridview OnItemClickListener

我成功创建了一个自定义gridview(带有图像和文本).现在我想写一个OnItemClickListener方法.我可以在OnItemClickListener方法上获得位置,但我希望能够点击"朋友"并看到"项目点击:朋友"

如何获取选择字符串而不是位置?这是我的源代码

public class Item {
Bitmap image;
String title;

public Item(Bitmap image, String title) {
    super();
    this.image = image;
    this.title = title;
}
public Bitmap getImage() {
    return image;
}
public void setImage(Bitmap image) {
    this.image = image;
}
public String getTitle() {
    return title;
}
public void setTitle(String title) {
    this.title = title;
}



public class CustomGridViewAdapter extends ArrayAdapter<Item> {
Context context;
int layoutResourceId;
ArrayList<Item> data = new ArrayList<Item>();
public static Item item ;

public CustomGridViewAdapter(Context context, int …
Run Code Online (Sandbox Code Playgroud)

android gridview onitemclicklistener

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

WebAPI POST,服务总是收到空值

我已经为这个问题搜索了几个小时,但似乎在任何地方都找不到任何答案

我已经构建了一个 ASP.NET WebAPI,它接受 JSON GET/POST 请求,当我使用 fiddler 或 google chrome 的高级休息客户端扩展时,它可以工作 A1。

现在我必须采用现有的 android 应用程序并修改它以与我的 WebAPI 一起使用。我已经清除了所有不需要的垃圾,但我仍然无法发布。GET 工作正常,我收到我的响应字符串,一切正常,但 POST 返回 400 Bad Request。

我的 webApi 控制器需要一个 ProblemReports 对象。问题报告是由我制作的,它是这样的:

    public class ProblemReports
{
    [Key]
    public int problem_id { get; set; }
    [Required]
    public Nullable<int> request_type { get; set; }
    [Required]
    public Nullable<int> problem_type_id { get; set; }
    public String picture_url { get; set; }
    public contact_information contact_information { get; set; }
    public problem_location problem_location { get; set; }
    public bool …
Run Code Online (Sandbox Code Playgroud)

c# asp.net android json asp.net-web-api

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