我正在使用android-async-http而且非常喜欢它.我遇到了POST数据的问题.我必须以下列格式将数据发布到API: -
<request>
<notes>Test api support</notes>
<hours>3</hours>
<project_id type="integer">3</project_id>
<task_id type="integer">14</task_id>
<spent_at type="date">Tue, 17 Oct 2006</spent_at>
</request>
Run Code Online (Sandbox Code Playgroud)
根据文档,我尝试使用它RequestParams,但它失败了.这是其他任何方式吗?我也可以发布等效的JSON.有任何想法吗?
我正在尝试使用一些数据启动本机添加联系人活动。我想通了大部分。现在我只是试图通过意图发送网站。这是代码
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
// Just some examples of information you can send to pre-fill out data for the
// user. See android.provider.ContactsContract.Intents.Insert for the complete
// list.
intent.putExtra(ContactsContract.Intents.Insert.NAME, "Foo");
intent.putExtra(ContactsContract.Intents.Insert.PHONE, "123456");
intent.putExtra(ContactsContract.Intents.Insert.EMAIL, "foo@foo.com");
intent.putExtra(ContactsContract.Intents.Insert.POSTAL, "foo drive, foo");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
android.provider.ContactsContract.Intents.Insert 没有网站字段。还有其他方法可以传递数据吗?