所以我有一个ParseQueryAdapter,我试图使用共享意图方法。我将它带到了共享意图函数的位置,但它只发送额外的文本而不是解析对象。我尝试使用Parse查询,但没有奏效。任何人有关于如何检索解析对象的想法。这里是我下面的代码:将分析对象添加到意图
//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,但我怎么能把它传递给意图? – user3900101 2014-12-02 23:06:32
尝试获取解析对象的id,这就是全部,并将其设置为额外字段,并在您收到意图时获取它 – Kiloreux 2014-12-03 13:47:38