本地插件开发的时候需要使用到activity 但是和官方的插件的activity产生了冲突 不知道怎么解决 不知道怎么销毁这个自己的activity 附上代码 JAVA
JAVA冲突代码
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
ContentResolver reContentResolverol =mWXSDKInstance.getContext().getContentResolver();
Uri contactData = data.getData();
@SuppressWarnings("deprecation")
Cursor cursor = reContentResolverol.query(contactData, null, null, null, null);
cursor.moveToFirst();
String username = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
Cursor phone = reContentResolverol.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactId, null, null);
while (phone.moveToNext()) {
String usernumber = phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
JSONObject result = new JSONObject();
result.put("name", username);
result.put("number",usernumber);
callback.invoke(result);
cursor.close();
phone.close();
}
}
}
5+sdk冲突代码
plus.gallery.pick((path)=>{
// this.src=path
uni.showToast({
title:path,
icon:'none'
})
// resolve(path)
},(e)=>{
// reject(e)
uni.showToast({
title:'取消选择'
})
},{filter:"image"})
在这当中 5+sdk返回path会出错 是否需要新建一个module来做这个插件 或者是销毁自定义的这个插件
0 个回复