android - 将解析对象添加到 Intent

标签 android android-intent parse-platform

所以我有一个 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/

相关文章:

java - Android 中的 ACTION_TIME_TICK 问题

android - 从共享 Intent 选择器中获取选定的应用程序名称?

android - 如何设置默认应用程序安装程序?

redirect - 安卓 : Redirect to a URL with my custom scheme doesn't work

ios - 在 Swift 中创建 PFUser 和对象之间的关系

android - 如何从多项目目录的顶层禁用 Android Gradle 插件中的 lint abortOnError

android - V8 独立应用程序仅在发布签名的 APK 时死于 SIGILL

android - 将任何 mp3 文件保存到我的应用程序中

Android:下载字体字体并在应用程序中使用

ios - 带有 PFObjects 的多个部分 UITableViewController