Error:Execution failed for task ':app:preDebugAndroidTestBuild'.

Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
>Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ.
See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details. To solve this I included the force usage for support annotations in my test app, since it is internally used by runner module.


how to download an image into a bitmap using the glide library in android

Glide.with(CurrentContext)
.load("url to image online saved")
.asBitmap()
.into(new SimpleTarget() {
@Override
public void onResourceReady(Bitmap retrivedbitmap, GlideAnimation glideAnimation) {
MyBitmapObj=bitmap;
}
});


 How does one use glide to download an image into a bitmap? 

hide and show text division in Blogger post on button click

We are going to see how to hide the text on the click of button and show again on another click.

First take a example of the MCQ question shown below in image. This question at end has the button which show/hide the answer based on the current visibility of answer text:

image not available try demo

Steps to use the demo for the hide/show text::
1) create new post
2) select HTML from the Compose/HTML button on top left of the toolbar of the blog
and delete default text on that page.
3) copy code given below
4) Test the hide/show text  after publishing /updating the page to blogger.
5) View updated page in browser and you can see the working demo.

Below is the code you need to copy paste to new blogger post:

code starts after this line
<div dir="ltr" style="text-align: left;" trbidi="on">
<b>here we have an exampe to hide and show the answer of the below question:</b><br />
<b><br /></b>

<b>Question: What is the color of sky:</b><br />
<div>
<b>(1) Purple</b></div>
<div>
<b>(2) Orange</b></div>
<div>
<b>(3) Green</b></div>
<div>
<b>(4) Blue&nbsp;</b></div>
<b><br /></b>

<!--(this is comment) here, this button below hide/show text on click, we are passing id of the division ("hideshow") to hide/show the content of division -->
<button onclick="if(document.getElementById('hideshow').style.display=='none') {
                                         document.getElementById('hideshow').style.display=''
                                                         }else{
                                     document.getElementById('hideshow').style.display='none'}" title="Show/hide content" type="button"><b>Show/hide Answer</b></button>
<br />
<!--(this is comment) here, on button click event, the state of the text will change as we are passing the id of the division we want to hide or show -->

<br />
<div id="hideshow" style="display: none;">
Correct answer is option - (4) Blue </div>
</div>

code ends before this line

hide and show text in Blogger on button click example

here we have an exampe to hide and show the answer of the below question:

Question: What is the color of sky:
(1) Purple
(2) Orange
(3) Green
(4) Blue 



Popular Posts