所以我有一个 ParseQueryAdapter 并且我正在尝试使用共享 Intent 方法。我得到了共享 Intent 起作用的地方,但它只发送额外的文本而不是解析对象。我尝试使用解析查询,但没有成功。任何知道如何检索解析对象的人。下面是我的代码:
//Set share button to
ImageButton shareButton = (ImageButton) v.findViewById (R.id.shareButton);
shareButton.setClickable (true);
shareButton.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick(View v) {
ParseQuery<ParseObject> query = ParseQuery.getQuery("Ads");
try {
query.get ("title").toString ();
} catch (ParseException e) {
e.printStackTrace ();
}
Bundle bundle = new Bundle ();
bundle.get ("title");
Intent sendIntent = new Intent (getContext (), ContentFeed.class);
sendIntent.setAction (Intent.ACTION_SEND);
sendIntent.putExtra (Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.putExtras (bundle);
sendIntent.setType ("text/plain");
getContext ().startActivity (Intent.createChooser (sendIntent, getContext ().getText (R.string.send_to)));
}
});
最佳答案
为此,您需要获取 ParseObject ID,将其传递给 Intent,然后在收到 ParseObject ID 后,从 Parse 数据库获取它。
关于android - 将解析对象添加到 Intent ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27256005/