How to put Drawable image to int array .NB: Image is not in R.Drawable class

Question!

I converted an image from BASE64 to imageByteArray the code is:

String imageBytes =item_image;
imageByteArray = Base64.decode(imageBytes, Base64.DEFAULT);

then I converted imageByteArray to Bitmap code is

bmp = BitmapFactory.decodeByteArray(imageByteArray,0, imageByteArray.length);

again I Converted that Bitmap image to Drawable code is below

Drawable d = new BitmapDrawable(getResources(), bmp);

So the Drawable image is inside the "d". These steps I do it for creating ViewPager in my application.

Anyone can help me to how to put this Drawable image to an Integer array.



Answers

Why do you want to have integer array of drawable?

What exactly you want to do?

If you are so obsessed in using array, then why don't you use List?

example:

List<Drawable> imageList = new ArrayList<>();
imageList.add(d);
//to get the item
Drawable image = imageList.get(i);
//where i is index of the item you want to get


To make sure all fields are filled before submission of the form:

<input type="radio" required>

The ' required ' attribute makes sure all fields are filled before the form can be submitted.



I don't have the privalage to comment but you can use the required field as follows

 <input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" required=true />

using this way the user will have to click all the required fields before submitting a form.



This video can help you solving your question :)
By: admin