Add vCard attachment preview
This commit is contained in:
parent
d874e16024
commit
f07abeb54c
58 changed files with 1263 additions and 117 deletions
|
|
@ -0,0 +1,15 @@
|
|||
package com.simplemobiletools.smsmessenger.helpers
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
import ezvcard.Ezvcard
|
||||
import ezvcard.VCard
|
||||
|
||||
fun parseVCardFromUri(context: Context, uri: Uri, callback: (vCards: List<VCard>) -> Unit) {
|
||||
ensureBackgroundThread {
|
||||
val inputStream = context.contentResolver.openInputStream(uri)
|
||||
val vCards = Ezvcard.parse(inputStream).all()
|
||||
callback(vCards)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue