gpt4 book ai didi

android - 将解析对象添加到 Intent

转载 作者:行者123 更新时间:2023-11-29 00:15:26 25 4
gpt4 key购买 nike

所以我有一个 ParseQueryAdapter,我正在尝试使用 share intent 方法。我把它带到了共享 Intent 起作用的地方,但它只发送额外的文本而不是解析对象。我尝试使用 Parse Query 但没有用。任何对如何检索解析对象有想法的人。下面是我的代码:

//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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com