use of com.jaku.request.QueryIconRequest in project RoMote by wseemann.
the class NotificationService method getAppIcon.
private void getAppIcon(String appId) {
String url = CommandHelper.getDeviceURL(this);
QueryIconRequest queryIconRequest = new QueryIconRequest(url, appId);
JakuRequest request = new JakuRequest(queryIconRequest, new IconParser());
new RequestTask(request, new RequestCallback() {
@Override
public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
try {
byte[] data = (byte[]) result.mResultValue;
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
mDevice = PreferenceUtils.getConnectedDevice(NotificationService.this);
notification = NotificationUtils.buildNotification(NotificationService.this, mDevice.getModelName(), mChannel.getTitle(), bitmap);
mNM.notify(NOTIFICATION, notification);
} catch (Exception ex) {
}
}
@Override
public void onErrorResponse(RequestTask.Result result) {
Log.d(TAG, "That didn't work!");
}
}).execute(RokuRequestTypes.query_icon);
}
Aggregations