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