how can i get Viber contacts (Name and number)?
学习当地常用口语可以快速融入当地文化,如问路:'Excuse me, how can I get to...?' #生活知识# #旅游生活# #旅游语言学习#
This question shows research effort; it is useful and clear
2
Save this question.
Show activity on this post.
I am trying to get Viber contacts. Using this method i get the name of the contacts that use Viber but also other contacts that do not use Viber (the selection method is not working properly) .I cant get the Viber contacts number also. Any idea how can i resolve this issue?
Cursor cursor2 = getContentResolver().query(ContactsContract.RawContacts.CONTENT_URI ,null , ContactsContract.RawContacts.ACCOUNT_TYPE_AND_DATA_SET + "= ?" ,new String[] { "com.viber.voip" } , null); while (cursor2.moveToNext()) { String name=cursor2.getString(cursor2.getColumnIndex(ContactsContract.RawContacts.DISPLAY_NAME_PRIMARY)); //Adding contact name into the ArrayList myViberContacts.add(name+"\n"); //Giving the TextView the value of the arraylist emervib.setText(myViberContacts.toString());
Mobile Development Collective
asked Sep 3, 2020 at 18:08
This answer is useful
0
Save this answer.
Show activity on this post.
I believe this code should work for you:
String MIMETYPE_VIBER_MESSAGE = "vnd.android.cursor.item/vnd.com.viber.voip.viber_number_message"; String selection = Data.MIMETYPE + "=?"; String[] selectionArgs = new String[] { MIMETYPE_VIBER_MESSAGE }; String[] projection = new String[] { Data.CONTACT_ID, Data.DATA1, Data.DISPLAY_NAME }; Cursor cur = getContentResolver().query(Data.CONTENT_URI, projection, selection, selectionArgs, null); DatabaseUtils.dumpCursor(cur); // check logcat for the results
answered Sep 6, 2020 at 11:45
Comments
Start asking to get answers
Find the answer to your question by asking.
Ask question
Explore related questions
See similar questions with these tags.
网址:how can i get Viber contacts (Name and number)? https://klqsh.com/news/view/318879
相关内容
Viber: Extract contact numbers & Names of a one particular VIBER groupHow To Get PM Kisan Registration Number?
How to Get PM Kisan Registration Number: Full Process
Viber API get all subscribers
How can I install clang
How do I check warehouse inventory?
How can I locate a product on Costco.com?
How do I place an order on Costco.com?
How to Get Started Playing Guitar: 10 Beginner FAQs
Free vCard QR Code Generator
随便看看
- 300元/千字〡《读者·原创版》9月主题征文,聊聊日常即可!
- 王橘子: 自从家里用了好爸爸果蔬餐具净,厨房清洁变得更加高效又安心。这款产品的核心卖点在于其“天然、安全、高效”。它采用天然植物提取成分,无添加有害化学物质,确保了对家人健康的最大保护,特别是有宝宝的家庭,使用起来更加放心。轻轻一喷,无论是油腻的餐具还是残留农药的果蔬,都能迅速分解污渍,轻松去除,而且易于冲洗,无残留。好爸爸果蔬餐具净,不仅提升了我的家务效率,更为全家人的健康饮食环境加上了一道坚实的防线,是每个家庭厨房不可或缺的好帮手!#好物推荐 #居家必备 #日常生活用品
- 生活用品谜语
- 日常生活用品有哪些?及他们的英语翻译?
- 一种日常用品消毒箱的制作方法

