pim

How to retrieve PIM contact's photo as Bitmap using RIM5.0?

时光怂恿深爱的人放手 提交于 2019-12-25 05:08:55
问题 I want to retrieve contacts' images and display them in BitmapField s. So I'm collecting Bitmap objects from contacts, using this code: Vector bitmaps = new Vector(); BlackBerryContactList contactList = (BlackBerryContactList)BlackBerryPIM.getInstance().openPIMList(BlackBerryPIM.CONTACT_LIST, BlackBerryPIM.READ_WRITE); Enumeration contactListItems = contactList.items(); int counter = 0; while (contactListItems.hasMoreElements()) { BlackBerryContact contact = (BlackBerryContact

How to use await in a parallel foreach?

流过昼夜 提交于 2019-12-01 04:23:14
So I sepnt the better part of the night trying to figure this out. I was fortunate to get introduced to the parallel.foreach yesterday and it works like I want it to do except from one detail. I have the following: Parallel.ForEach(data, (d) => { try { MyMethod(d, measurements); } catch (Exception e) { // logg } }); Within the method "MyMethod" I have alot of logic that gets done and most of it is fine but I make api calls where I fetch data and I use async task for this to be able to use "await" in order for the code to wait untill that specific part gets executed and then move on: private

How to use await in a parallel foreach?

≡放荡痞女 提交于 2019-12-01 01:26:41
问题 So I sepnt the better part of the night trying to figure this out. I was fortunate to get introduced to the parallel.foreach yesterday and it works like I want it to do except from one detail. I have the following: Parallel.ForEach(data, (d) => { try { MyMethod(d, measurements); } catch (Exception e) { // logg } }); Within the method "MyMethod" I have alot of logic that gets done and most of it is fine but I make api calls where I fetch data and I use async task for this to be able to use