<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6368102395123826010</id><updated>2025-04-20T15:49:05.043-07:00</updated><title type='text'>AndroidJug, Free Android Tutorials, Open Source Codes </title><subtitle type='html'>Free Android Tutorials, Android Tips, Android Developments, Free Android Codings., Free Android App Examples, Open Source Code for Android</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>209</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-3555513037854715169</id><published>2017-05-15T21:38:00.003-07:00</published><updated>2017-05-15T21:38:46.544-07:00</updated><title type='text'>how to read json file from assets folder in android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px; line-height: 1.3; margin: 0px 0px 0.5em; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 22px;&quot;&gt;if the question as json array like follwing&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px; line-height: 1.3; margin: 0px 0px 0.5em; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 itemprop=&quot;name&quot; style=&quot;background-color: white; border: 0px; line-height: 1.3; margin: 0px 0px 0.5em; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 22px;&quot;&gt;[{&quot;questionId&quot;:&quot;Q18868&quot;,&quot;questionValue&quot;:&quot;What is the minimum age for obtaining an Alabama driver license?&quot;,&quot;choice1&quot;:&quot;At least 16 years.&quot;,&quot;choice2&quot;:&quot;At least 17 years.&quot;,&quot;choice3&quot;:&quot;At least 18 years.&quot;,&quot;choice4&quot;:&quot;At least 19 years.&quot;,&quot;answer&quot;:&quot;1&quot;,&quot;imageName&quot;:&quot;NA&quot;},{&quot;questionId&quot;:&quot;Q18873&quot;,&quot;questionValue&quot;:&quot;Whether Alabama license may be issued to persons under age 19 years, without secondary school graduation or current attendance?&quot;,&quot;choice1&quot;:&quot;No.&quot;,&quot;choice2&quot;:&quot;Yes.&quot;,&quot;choice3&quot;:&quot;Yes, on special permission.&quot;,&quot;choice4&quot;:&quot;Any thing else.&quot;,&quot;answer&quot;:&quot;1&quot;,&quot;imageName&quot;:&quot;NA&quot;},{&quot;questionId&quot;:&quot;Q19001&quot;,&quot;questionValue&quot;:&quot;For how many moving traffic violations on a GDL (graduated driver license), you license will be suspended?&quot;,&quot;choice1&quot;:&quot;1 or more.&quot;,&quot;choice2&quot;:&quot;2 or more.&quot;,&quot;choice3&quot;:&quot;3 or more.&quot;,&quot;choice4&quot;:&quot;4 or more.&quot;,&quot;answer&quot;:&quot;2&quot;,&quot;imageName&quot;:&quot;NA&quot;},{&quot;questionId&quot;:&quot;Q19323&quot;,&quot;questionValue&quot;:&quot;For which persons Graduated Driver License (GDL) system is not applicable?&quot;,&quot;choice1&quot;:&quot;Persons aged 18 years or older.&quot;,&quot;choice2&quot;:&quot;Persons aged 17 or older with valid driver license for 6 months.&quot;,&quot;choice3&quot;:&quot;Persons aged 16 or older, who are married or head of a household.&quot;,&quot;choice4&quot;:&quot;All the above persons.&quot;,&quot;answer&quot;:&quot;4&quot;,&quot;imageName&quot;:&quot;NA&quot;},{&quot;questionId&quot;:&quot;Q19324&quot;,&quot;questionValue&quot;:&quot;Whether persons who have been legally relieved of minority status, is eligible for GDL system?&quot;,&quot;choice1&quot;:&quot;NO.&quot;,&quot;choice2&quot;:&quot;Yes.&quot;,&quot;choice3&quot;:&quot;Yes, if under 16 years.&quot;,&quot;choice4&quot;:&quot;Any thing else.&quot;,&quot;answer&quot;:&quot;1&quot;,&quot;imageName&quot;:&quot;NA&quot;},{&quot;questionId&quot;:&quot;Q19325&quot;,&quot;questionValue&quot;:&quot;Who should accompany a person aged 15 years with learner\u0027s license in the vehicle, while driving?&quot;,&quot;choice1&quot;:&quot;A parent or legal guardian.&quot;,&quot;choice2&quot;:&quot;A licensed driver aged 21 years or older.&quot;,&quot;choice3&quot;:&quot;A licensed or certified driving instructor.&quot;,&quot;choice4&quot;:&quot;Any one of the above persons.&quot;,&quot;answer&quot;:&quot;4&quot;,&quot;imageName&quot;:&quot;NA&quot;},{&quot;questionId&quot;:&quot;Q19326&quot;,&quot;questionValue&quot;:&quot;In which seat of the vehicle, the person accompanying the driver aged 15 years with learner\u0027s license should sit?&quot;,&quot;choice1&quot;:&quot;Seat next to the driver.&quot;,&quot;choice2&quot;:&quot;Any front seat.&quot;,&quot;choice3&quot;:&quot;Seat behind the driver.&quot;,&quot;choice4&quot;:&quot;Any where else.&quot;,&quot;answer&quot;:&quot;1&quot;,&quot;imageName&quot;:&quot;NA&quot;}]&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;div&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 22px;&quot;&gt;JsonParser .java&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #242729; font-family: Arial, Helvetica Neue, Helvetica, sans-serif;&quot;&gt;&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;package com.alabama;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import java.io.IOException;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import java.io.InputStream;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import java.util.ArrayList;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import org.json.JSONArray;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import org.json.JSONException;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import org.json.JSONObject;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.app.Activity;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;public class JsonParser {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String fileName;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Activity activity;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public JsonParser(Activity activity,String fileName) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.activity=activity;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.fileName=fileName;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public ArrayList&amp;lt;QuestBeen&amp;gt; getQuestion() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;ArrayList&amp;lt;QuestBeen&amp;gt; list=new ArrayList&amp;lt;QuestBeen&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;JSONArray array;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;array = new JSONArray(loadJSONFromAsset());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for(int i=0;i&amp;lt;array.length();i++){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;JSONObject json_data = array.getJSONObject(i);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;QuestBeen been=new QuestBeen();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setQuestionId(json_data.getString(&quot;questionId&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setQuestionValue(json_data.getString(&quot;questionValue&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setChoice1(json_data.getString(&quot;choice1&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setChoice2(json_data.getString(&quot;choice2&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setChoice3(json_data.getString(&quot;choice3&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setChoice4(json_data.getString(&quot;choice4&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;been.setAnswer(json_data.getString(&quot;answer&quot;));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;list.add(been);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (JSONException e) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return list;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public String loadJSONFromAsset() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;String json = null;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;try {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStream is = activity.getAssets().open(fileName);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int size = is.available();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] buffer = new byte[size];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;is.read(buffer);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;is.close();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;json = new String(buffer, &quot;UTF-8&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;} catch (IOException ex) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ex.printStackTrace();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return null;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;return json;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;reading files in the activity&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;package com.alabama;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import java.util.ArrayList;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.app.Activity;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.content.Intent;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.os.Bundle;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.util.Log;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.view.View;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.view.View.OnClickListener;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.widget.Button;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.widget.RadioButton;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.widget.RadioGroup;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.widget.RadioGroup.OnCheckedChangeListener;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.widget.TextView;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;import android.widget.Toast;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;public class TestActivity extends Activity{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int ans=0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int id=0;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int rightValue=0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ArrayList&amp;lt;QuestBeen&amp;gt; question;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;JsonParser parser;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;TextView textViewQuestion,textViewHead;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;RadioGroup group;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;RadioButton choice1,choice2,choice3,choice4;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Button buttonPrev,buttonNext;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int pos;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;protected void onCreate(Bundle savedInstanceState) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super.onCreate(savedInstanceState);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setContentView(R.layout.activity_test);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pos=getIntent().getExtras().getInt(&quot;position&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pos=10+pos;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;parser=new JsonParser(TestActivity.this,&quot;QC&quot;+pos+&quot;.json&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;--------------------------&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(&quot;json &quot;, parser.loadJSONFromAsset().toString());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;question=parser.getQuestion();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;GUI();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void GUI() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;textViewQuestion=(TextView)findViewById(R.id.textViewQuestion);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;textViewHead=(TextView)findViewById(R.id.textViewHead);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;group=(RadioGroup)findViewById(R.id.radioGroup1);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice1=(RadioButton)findViewById(R.id.radio0);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice2=(RadioButton)findViewById(R.id.radio1);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice3=(RadioButton)findViewById(R.id.radio2);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice4=(RadioButton)findViewById(R.id.radio3);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;textViewHead.setText(&quot;1/&quot;+question.size());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;ConstantValues.totaQuestin=question.size();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;buttonPrev=(Button)findViewById(R.id.button1);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;buttonNext=(Button)findViewById(R.id.button2);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setVal();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;group.setOnCheckedChangeListener(new OnCheckedChangeListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onCheckedChanged(RadioGroup group, int checkedId) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; RadioButton rb = (RadioButton) group.findViewById(checkedId);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; int radioButtonID = group.getCheckedRadioButtonId();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; View radioButton = group.findViewById(radioButtonID);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; int idx = group.indexOfChild(radioButton);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; if(idx==ans){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt; rightValue=1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt; rightValue=0;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;//Toast.makeText(getApplicationContext(), idx+&quot;---&quot;, Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;buttonNext.setOnClickListener(new OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onClick(View v) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ConstantValues.answers.add(id,rightValue);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;id++;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Log.d(&quot;question&quot;, id+&quot;--&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(id&amp;lt;=question.size()-1)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;setVal();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;else{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Toast.makeText(getApplicationContext(), &quot;Result&quot;, Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Intent intent=new Intent(TestActivity.this,ResultActivity.class);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;startActivity(intent);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Log.d(&quot;-----------&quot;, ConstantValues.answers.toString());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;buttonPrev.setOnClickListener(new OnClickListener() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onClick(View v) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;id--;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Log.d(&quot;question&quot;, id+&quot;--&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(id&amp;lt;=0){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;id=0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Toast.makeText(getApplicationContext(), &quot;No Questions&quot;, Toast.LENGTH_SHORT).show();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;setVal();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 22px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void setVal() {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;ans=Integer.parseInt(question.get(id).getAnswer());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;group.clearCheck();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;textViewHead.setText(id+&quot;/&quot;+question.size());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;textViewQuestion.setText(question.get(id).getQuestionValue());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice1.setText(question.get(id).getChoice1());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice2.setText(question.get(id).getChoice2());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice3.setText(question.get(id).getChoice3());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;choice4.setText(question.get(id).getChoice4());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 22px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: 22px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 22px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: 22px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 22px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/3555513037854715169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2017/05/how-to-read-json-file-from-assets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/3555513037854715169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/3555513037854715169'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2017/05/how-to-read-json-file-from-assets.html' title='how to read json file from assets folder in android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-8434767204254989713</id><published>2017-04-18T01:45:00.002-07:00</published><updated>2017-04-18T01:45:40.947-07:00</updated><title type='text'>Android Custom Calendar</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;CalendarAdapter.java&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white;&quot;&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.content.Context;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.graphics.Color;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.text.SimpleDateFormat;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.Collections;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.GregorianCalendar;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.util.Log;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.view.LayoutInflater;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.view.View;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.view.ViewGroup;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.BaseAdapter;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.ImageView;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.TextView;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.text.DateFormat;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.ArrayList;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.HashSet;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.List;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.Locale;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.Map;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.Set;




&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt; * Created by Mafiree on 11/7/2016.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt; */&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public class &lt;/span&gt;CalendarAdapter &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;extends &lt;/span&gt;BaseAdapter {
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private &lt;/span&gt;Context mContext;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private &lt;/span&gt;java.util.Calendar month;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;GregorianCalendar pmonth; &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// calendar instance for previous month&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;    /**&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;     * calendar instance for previous month for getting complete view&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;     */&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;GregorianCalendar pmonthmaxset;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private &lt;/span&gt;GregorianCalendar selectedDate;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;firstDay;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;maxWeeknumber;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;maxP;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;calMaxP;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;lastWeekDay;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;leftDays;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;mnthlength;
    String itemvalue, curentDateString;
    DateFormat df;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private &lt;/span&gt;ArrayList&amp;lt;String&amp;gt; items;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public static &lt;/span&gt;List&amp;lt;String&amp;gt; dayString;
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private &lt;/span&gt;View previousView;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;CalendarAdapter(Context c, GregorianCalendar monthCalendar) {

        CalendarAdapter.dayString = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;ArrayList&amp;lt;String&amp;gt;();
        month = monthCalendar;
        selectedDate = (GregorianCalendar) monthCalendar.clone();
        mContext = c;
        month.set(GregorianCalendar.DAY_OF_MONTH, &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.items = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;ArrayList&amp;lt;String&amp;gt;();
        df = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;SimpleDateFormat(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;yyyy-MM-dd&quot;&lt;/span&gt;, Locale.US);
        curentDateString = df.format(selectedDate.getTime());
        refreshDays();
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;setItems(ArrayList&amp;lt;String&amp;gt; items) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;i = &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;; i != items.size(); i++) {
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(items.get(i).length() == &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;) {
                items.set(i, &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;0&quot; &lt;/span&gt;+ items.get(i));
            }
        }
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.items = items;
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public int &lt;/span&gt;getCount() {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;dayString.size();
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;Object getItem(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;position) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;dayString.get(position);
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public long &lt;/span&gt;getItemId(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;position) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;
    }

    &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// create a new view for each item referenced by the Adapter&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;View getView(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;position, View convertView, ViewGroup parent) {
        View v = convertView;
        TextView dayView;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(convertView == &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null&lt;/span&gt;) { &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// if it&#39;s not recycled, initialize some&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            // attributes&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;LayoutInflater vi = (LayoutInflater) mContext
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.calendar_item, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null&lt;/span&gt;);

        }
        dayView = (TextView) v.findViewById(R.id.date);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// separates daystring into parts.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;String[] separatedTime = dayString.get(position).split(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;-&quot;&lt;/span&gt;);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// taking last part of date. ie; 2 from 2012-12-02&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;String gridvalue = separatedTime[&lt;span style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;].replaceFirst(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;^0*&quot;&lt;/span&gt;, &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;&quot;&lt;/span&gt;);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// checking whether the day is in current month or not.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;((Integer.parseInt(gridvalue) &amp;gt; &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;) &amp;amp;&amp;amp; (position &amp;lt; firstDay)) {
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// setting offdays to white color.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;dayView.setTextColor(Color.WHITE);
            dayView.setClickable(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;);
            dayView.setFocusable(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;);
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else if &lt;/span&gt;((Integer.parseInt(gridvalue) &amp;lt; &lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;) &amp;amp;&amp;amp; (position &amp;gt; &lt;span style=&quot;color: blue;&quot;&gt;28&lt;/span&gt;)) {
            dayView.setTextColor(Color.WHITE);
            dayView.setClickable(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;);
            dayView.setFocusable(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;false&lt;/span&gt;);
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else &lt;/span&gt;{
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// setting curent month&#39;s days in blue color.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            &lt;/span&gt;dayView.setTextColor(Color.BLUE);
        }

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(dayString.get(position).equals(curentDateString)) {
            setSelected(v);
            previousView = v;
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else &lt;/span&gt;{
           &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// v.setBackgroundResource(R.drawable.list_item_background);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;}
        dayView.setText(gridvalue);

        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// create date string for comparison&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;String date = dayString.get(position);

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(date.length() == &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;) {
            date = &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;0&quot; &lt;/span&gt;+ date;
        }
        String monthStr = &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;&quot; &lt;/span&gt;+ (month.get(GregorianCalendar.MONTH) + &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(monthStr.length() == &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;) {
            monthStr = &lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;0&quot; &lt;/span&gt;+ monthStr;
        }

        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// show icon if date is not empty and it exists in the items array&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;ImageView iw = (ImageView) v.findViewById(R.id.date_icon);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(date.length() &amp;gt; &lt;span style=&quot;color: blue;&quot;&gt;0 &lt;/span&gt;&amp;amp;&amp;amp; items != &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null &lt;/span&gt;&amp;amp;&amp;amp; items.contains(date)) {
            iw.setVisibility(View.VISIBLE);
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else &lt;/span&gt;{
            iw.setVisibility(View.INVISIBLE);
        }
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;v;
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;View setSelected(View view) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(previousView != &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null&lt;/span&gt;) {
            &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//previousView.setBackgroundResource(R.drawable.list_item_background);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;}
        previousView = view;
      &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//  view.setBackgroundResource(R.drawable.calendar_cel_selectl);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;view;
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;refreshDays() {
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// clear items&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;items.clear();
        dayString.clear();
        pmonth = (GregorianCalendar) month.clone();
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// month start day. ie; sun, mon, etc&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;firstDay = month.get(GregorianCalendar.DAY_OF_WEEK);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// finding number of weeks in current month.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;maxWeeknumber = month.getActualMaximum(GregorianCalendar.WEEK_OF_MONTH);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// allocating maximum row number for the gridview.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;mnthlength = maxWeeknumber * &lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;;
        maxP = getMaxP(); &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// previous month maximum day 31,30....&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;calMaxP = maxP - (firstDay - &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// calendar offday starting 24,25 ...&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        /**&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         * Calendar instance for getting a complete gridview including the three&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         * month&#39;s (previous,current,next) dates.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         */&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;pmonthmaxset = (GregorianCalendar) pmonth.clone();
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         * setting the start date as previous month&#39;s required date.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         */&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;pmonthmaxset.set(GregorianCalendar.DAY_OF_MONTH, calMaxP + &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);

        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         * filling calendar gridview.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;         */&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;for &lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;n = &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;; n &amp;lt; mnthlength; n++) {

            itemvalue = df.format(pmonthmaxset.getTime());
            pmonthmaxset.add(GregorianCalendar.DATE, &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);
            dayString.add(itemvalue);

        }
    }

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private int &lt;/span&gt;getMaxP() {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;maxP;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if &lt;/span&gt;(month.get(GregorianCalendar.MONTH) == month
                .getActualMinimum(GregorianCalendar.MONTH)) {
            pmonth.set((month.get(GregorianCalendar.YEAR) - &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;),
                    month.getActualMaximum(GregorianCalendar.MONTH), &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);
        } &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;else &lt;/span&gt;{
            pmonth.set(GregorianCalendar.MONTH,
                    month.get(GregorianCalendar.MONTH) - &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;);
        }
        maxP = pmonth.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;maxP;
    }

}&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;public class CalendarView extends Activity {

&lt;/span&gt;&lt;/span&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;GregorianCalendar month, itemmonth;&lt;/pre&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;

 public CalendarAdapter adapter;// adapter instance
 public Handler handler;// for grabbing some event values for showing the dot
       // marker.
 public ArrayList&amp;lt;String&amp;gt; items; // container to store calendar items which
         // needs showing the event marker

 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.calendar);

 &lt;/span&gt;&lt;/span&gt;month = (GregorianCalendar) GregorianCalendar.getInstance();&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;itemmonth = (GregorianCalendar) month.clone();&lt;/pre&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;
  items = new ArrayList&amp;lt;String&amp;gt;();
  adapter = new CalendarAdapter(this, month);

  GridView gridview = (GridView) findViewById(R.id.gridview);
  gridview.setAdapter(adapter);

  handler = new Handler();
  handler.post(calendarUpdater);

  TextView title = (TextView) findViewById(R.id.title);
  title.setText(android.text.format.DateFormat.format(&quot;MMMM yyyy&quot;, month));

  RelativeLayout previous = (RelativeLayout) findViewById(R.id.previous);

  previous.setOnClickListener(new OnClickListener() {

   @Override
   public void onClick(View v) {
    setPreviousMonth();
    refreshCalendar();
   }
  });

  RelativeLayout next = (RelativeLayout) findViewById(R.id.next);
  next.setOnClickListener(new OnClickListener() {

   @Override
   public void onClick(View v) {
    setNextMonth();
    refreshCalendar();

   }
  });

  gridview.setOnItemClickListener(new OnItemClickListener() {
   public void onItemClick(AdapterView&amp;lt;?&amp;gt; parent, View v,
     int position, long id) {

    ((CalendarAdapter) parent.getAdapter()).setSelected(v);
    String selectedGridDate = CalendarAdapter.dayString
      .get(position);
    String[] separatedTime = selectedGridDate.split(&quot;-&quot;);
    String gridvalueString = separatedTime[2].replaceFirst(&quot;^0*&quot;,
      &quot;&quot;);// taking last part of date. ie; 2 from 2012-12-02.
    int gridvalue = Integer.parseInt(gridvalueString);
    // navigate to next or previous month on clicking offdays.
    if ((gridvalue &amp;gt; 10) &amp;amp;&amp;amp; (position &amp;lt; 8)) {
     setPreviousMonth();
     refreshCalendar();
    } else if ((gridvalue &amp;lt; 7) &amp;amp;&amp;amp; (position &amp;gt; 28)) {
     setNextMonth();
     refreshCalendar();
    }
    ((CalendarAdapter) parent.getAdapter()).setSelected(v);

    showToast(selectedGridDate);

   }
  });
 }

 protected void setNextMonth() {
  if (month.get(Calendar.MONTH) == month.getActualMaximum(Calendar.MONTH)) {
   month.set((month.get(Calendar.YEAR) + 1),
     month.getActualMinimum(Calendar.MONTH), 1);
  } else {
   month.set(Calendar.MONTH, month.get(Calendar.MONTH) + 1);
  }

 }

 protected void setPreviousMonth() {
  if (month.get(Calendar.MONTH) == month.getActualMinimum(Calendar.MONTH)) {
   month.set((month.get(Calendar.YEAR) - 1),
     month.getActualMaximum(Calendar.MONTH), 1);
  } else {
   month.set(Calendar.MONTH, month.get(Calendar.MONTH) - 1);
  }

 }

 protected void showToast(String string) {
  Toast.makeText(this, string, Toast.LENGTH_SHORT).show();

 }

 public void refreshCalendar() {
  TextView title = (TextView) findViewById(R.id.title);

  adapter.refreshDays();
  adapter.notifyDataSetChanged();
  handler.post(calendarUpdater); // generate some calendar items

  title.setText(android.text.format.DateFormat.format(&quot;MMMM yyyy&quot;, month));
 }

 public Runnable calendarUpdater = new Runnable() {

  @Override
  public void run() {
   items.clear();

   // Print dates of the current week
   DateFormat df = new SimpleDateFormat(&quot;yyyy-MM-dd&quot;);
   String itemvalue;
   for (int i = 0; i &amp;lt; 7; i++) {
    itemvalue = df.format(itemmonth.getTime());
    itemmonth.add(Calendar.DATE, 1);
    items.add(&quot;2012-09-12&quot;);
    items.add(&quot;2012-10-07&quot;);
    items.add(&quot;2012-10-15&quot;);
    items.add(&quot;2012-10-20&quot;);
    items.add(&quot;2012-11-30&quot;);
    items.add(&quot;2012-11-28&quot;);
   }

   adapter.setItems(items);
   adapter.notifyDataSetChanged();
  }
 };
}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/8434767204254989713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2017/04/android-custom-calendar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8434767204254989713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8434767204254989713'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2017/04/android-custom-calendar.html' title='Android Custom Calendar'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-6773870924492798080</id><published>2017-02-10T05:17:00.000-08:00</published><updated>2017-02-10T05:17:42.774-08:00</updated><title type='text'>Making TextView scrollable in Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;TextView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; tv &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;TextView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setBackgroundResource&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;drawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;splash&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setTypeface&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;face&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setTextSize&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setTextColor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;BROWN&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setGravity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Gravity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;CENTER_VERTICAL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Gravity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;CENTER_HORIZONTAL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setOnTouchListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;OnTouchListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; onTouch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;MotionEvent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Random&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; r &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Random&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;nextInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;101&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getAction&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;ACTION_DOWN&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;tips&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;]);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setBackgroundResource&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;drawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;inner&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
setContentView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;tv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/6773870924492798080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2017/02/making-textview-scrollable-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6773870924492798080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6773870924492798080'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2017/02/making-textview-scrollable-in-android.html' title='Making TextView scrollable in Android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-7907230983736461302</id><published>2017-02-10T03:05:00.002-08:00</published><updated>2017-02-10T03:05:15.011-08:00</updated><title type='text'>PagerAdapter Class</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;b&gt;This is the main activity&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;myPagerAdapter=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;MyPagerAdapter(TopNewsAcivity.&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;,arrayList);
verticalViewPager=(VerticalViewPager)findViewById(R.id.view_pager);
verticalViewPager.setAdapter(myPagerAdapter);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;For dynamic PagerAdapter&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;MyPagerAdapter &lt;/span&gt;.class&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;package &lt;/span&gt;news.com.mynews.adapter;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.app.Activity;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.graphics.Color;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.graphics.Typeface;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.support.v4.view.PagerAdapter;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.support.v7.widget.ActionBarOverlayLayout.LayoutParams;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.text.Html;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.view.View;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.view.ViewGroup;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.ImageView;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.ImageView.ScaleType;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.LinearLayout;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;android.widget.TextView;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;com.squareup.picasso.Picasso;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;java.util.ArrayList;

&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;news.com.mynews.R;
&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;import &lt;/span&gt;news.com.mynews.bean.NewsBean;

&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt; * Created by Mafiree on 12/19/2016.&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt; */&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//http://android-er.blogspot.in/2014/04/example-of-viewpager-with-custom.html&lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public class &lt;/span&gt;MyPagerAdapter &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;extends &lt;/span&gt;PagerAdapter {


    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;NumberOfPages = &lt;span style=&quot;color: blue;&quot;&gt;5&lt;/span&gt;;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int&lt;/span&gt;[] res = {
            android.R.drawable.ic_dialog_alert,
            android.R.drawable.ic_menu_camera,
            android.R.drawable.ic_menu_compass,
            android.R.drawable.ic_menu_directions,
            android.R.drawable.ic_menu_gallery};
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int&lt;/span&gt;[] backgroundcolor = {
            &lt;span style=&quot;color: blue;&quot;&gt;0xFF101010&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;0xFF202020&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;0xFF303030&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;0xFF404040&lt;/span&gt;,
            &lt;span style=&quot;color: blue;&quot;&gt;0xFF505050&lt;/span&gt;};

    Activity activity;
    ArrayList&amp;lt;NewsBean&amp;gt; list;

    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;MyPagerAdapter(Activity activity,ArrayList&amp;lt;NewsBean&amp;gt; list) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.activity=activity;
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;this&lt;/span&gt;.list=list;
    }

    @Override
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public int &lt;/span&gt;getCount() {
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//return NumberOfPages;&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;list.size();
    }

    @Override
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public boolean &lt;/span&gt;isViewFromObject(View view, Object object) {
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;view == object;
    }

    @Override
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public &lt;/span&gt;Object instantiateItem(ViewGroup container, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;position) {

        ImageView imageView=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;ImageView(activity);
        imageView.setScaleType(ScaleType.FIT_XY);

        TextView textView = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;TextView(activity);
        textView.setTextColor(Color.BLACK);
       &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// textView.setTextSize(18);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;textView.setTypeface(Typeface.DEFAULT_BOLD);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//textView.setText(String.valueOf(position));&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;      //  textView.setText(list.get(position).getTitle());&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;n=&lt;span style=&quot;color: blue;&quot;&gt;200&lt;/span&gt;;
        String upToNCharacters = list.get(position).getDescription().substring(&lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;, Math.min(list.get(position).getDescription().length(), n));

        textView.setText(Html.fromHtml(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;&amp;lt;h2&amp;gt;&quot;&lt;/span&gt;+list.get(position).getTitle()+&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;&amp;lt;/h2&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;&quot;&lt;/span&gt;+upToNCharacters+&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot; here&amp;lt;/p&amp;gt;&quot;&lt;/span&gt;));

        TextView textContent=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;TextView(activity);
&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//        textContent.setText(Color.WHITE);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;textContent.setTextColor(Color.GRAY);
       &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// textContent.setTextSize(16);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;       // textContent.setText(Html.fromHtml(&quot;&amp;lt;h2&amp;gt;Title&amp;lt;/h2&amp;gt;&amp;lt;br&amp;gt;&amp;lt;p&amp;gt;Description here&amp;lt;/p&amp;gt;&quot;));&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;System.out.println(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;*******************************************&quot;&lt;/span&gt;);
        String imageUrl=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null&lt;/span&gt;;
        imageUrl=&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;http://bestcinema.in/wp-content/uploads/&quot;&lt;/span&gt;+list.get(position).getImageURL();
       &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;try &lt;/span&gt;{
            Picasso.with(activity).load(imageUrl).resize(&lt;span style=&quot;color: blue;&quot;&gt;250&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;350&lt;/span&gt;).into(imageView);
        }&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;catch &lt;/span&gt;(Exception e){
            e.printStackTrace();
        }

        LayoutParams imageParams = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;LayoutParams(
                LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
        imageView.setLayoutParams(imageParams);

        LinearLayout layout = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;LinearLayout(activity);
        layout.setOrientation(LinearLayout.VERTICAL);
        LayoutParams layoutParams = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;LayoutParams(
                LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//layout.setBackgroundColor(Color.BLUE);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;layout.setLayoutParams(layoutParams);

        layout.addView(imageView);
        layout.addView(textView);
        layout.addView(textContent);

        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;final int &lt;/span&gt;page = position;
        layout.setPadding(&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;7&lt;/span&gt;);


        LinearLayout layoutBotom = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;LinearLayout(activity);
        layoutBotom.setOrientation(LinearLayout.HORIZONTAL);
        LayoutParams layoutParamsBottom = &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;LayoutParams(
                LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
        &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//layout.setBackgroundColor(Color.BLUE);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;layoutBotom.setLayoutParams(layoutParamsBottom);


        ImageView imageViewShare=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;ImageView(activity);
        imageViewShare.setBackgroundResource(R.drawable.ic_menu_share);

        ImageView imageViewSend=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;ImageView(activity);
        imageViewSend.setBackgroundResource(R.drawable.ic_menu_send);

        layoutBotom.addView(imageViewShare);
        layoutBotom.addView(imageViewSend);

        layout.addView(layoutBotom);

        container.addView(layout);
        &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return &lt;/span&gt;layout;
    }

    @Override
    &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;destroyItem(ViewGroup container, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;int &lt;/span&gt;position, Object object) {
        container.removeView((LinearLayout)object);
    }


}&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;For Static PagerAdapter&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;CustomPagerAdapter &lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;extends&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;PagerAdapter {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;Context mContext;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;LayoutInflater mLayoutInflater;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;CustomPagerAdapter(Context context) {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;mContext = context;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: grey; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;@Override&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;int&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;getCount() {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;mResources.length;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: grey; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;@Override&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;boolean&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;isViewFromObject(View view, Object object) {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;view == ((LinearLayout) object);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: grey; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;@Override&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;Object instantiateItem(ViewGroup container, &lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;int&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;position) {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;View itemView = mLayoutInflater.inflate(R.layout.pager_item, container, &lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;false&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number25 index24 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;ImageView imageView = (ImageView) itemView.findViewById(R.id.imageView);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number26 index25 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;imageView.setImageResource(mResources[position]);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number27 index26 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number28 index27 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;container.addView(itemView);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number29 index28 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number30 index29 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;itemView;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number31 index30 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number32 index31 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;line number33 index32 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: grey; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;@Override&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number34 index33 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;public&lt;/code&gt; &lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;void&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;destroyItem(ViewGroup container, &lt;/code&gt;&lt;code class=&quot;java keyword&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #006699; direction: ltr; display: inline; float: none; font-size: 1em; font-weight: bold; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;int&lt;/code&gt; &lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;position, Object object) {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number35 index34 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;container.removeView((LinearLayout) object);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number36 index35 alt1&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java spaces&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number37 index36 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number37 index36 alt2&quot; style=&quot;background-image: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: #1a1a1a; direction: ltr; float: none; font-family: monaco, consolas, &amp;quot;bitstream vera sans mono&amp;quot;, &amp;quot;courier new&amp;quot;, courier, monospace; font-size: 16px; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;code class=&quot;java plain&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-shadow: none; box-sizing: content-box; color: black; direction: ltr; display: inline; float: none; font-size: 1em; height: auto; left: auto; line-height: 1.1em; margin: 0px; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/7907230983736461302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2017/02/pageradapter-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/7907230983736461302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/7907230983736461302'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2017/02/pageradapter-class.html' title='PagerAdapter Class'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-3525467478938698452</id><published>2016-11-03T22:21:00.003-07:00</published><updated>2016-11-03T22:21:51.760-07:00</updated><title type='text'>Android searchview expand hide Toolbar title</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
@Override&lt;br /&gt;
public boolean onCreateOptionsMenu(final Menu menu) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; getMenuInflater().inflate(R.menu.menu_main, menu);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; final MenuItem searchItem = menu.findItem(R.id.search);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SearchView searchView = (android.widget.SearchView) searchItem.getActionView();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Detect SearchView icon clicks&lt;br /&gt;
&amp;nbsp; &amp;nbsp; searchView.setOnSearchClickListener(new View.OnClickListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onClick(View v) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setItemsVisibility(menu, searchItem, false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Detect SearchView close&lt;br /&gt;
&amp;nbsp; &amp;nbsp; searchView.setOnCloseListener(new SearchView.OnCloseListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public boolean onClose() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setItemsVisibility(menu, searchItem, true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return super.onCreateOptionsMenu(menu);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
******************************************************************************&lt;br /&gt;
&lt;br /&gt;
for my case&lt;br /&gt;
&lt;br /&gt;
my Toolbar is&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt; &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;private void &lt;/span&gt;actionBarView(){


        toolbar = (Toolbar) findViewById(com.mafiree.salezstorm.R.id.toolbar);

        setSupportActionBar(toolbar);
        getSupportActionBar().setTitle(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;Tittle&quot;&lt;/span&gt;);

 &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;/*       if(toolbar != null) {&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            setSupportActionBar(toolbar);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            getSupportActionBar().setTitle(&quot;My custom toolbar!&quot;);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            getSupportActionBar().setHomeButtonEnabled(true);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;            getSupportActionBar().setDisplayHomeAsUpEnabled(true);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        }*/&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        //back button action&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;ImageView imageview_back=(ImageView)toolbar.findViewById(com.mafiree.salezstorm.R.id.imageview_back);

        imageview_back.setOnClickListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;View.OnClickListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;onClick(View view) {
                &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;// Toast.makeText(getApplicationContext(),&quot;back clicked&quot;,Toast.LENGTH_LONG).show();&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;                &lt;/span&gt;finish();
            }
        });



        textview_property=(TextView)findViewById(R.id.textview_property_list);
      &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//  textview_property.setVisibility(View.GONE);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;        &lt;/span&gt;textview_property.setOnClickListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;OnClickListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;onClick(View v) {
                finish();
            }
        });

&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;    &lt;/span&gt;}&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;my Option menu&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;&lt;pre style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;   MenuInflater inflater=getMenuInflater();
        inflater.inflate(R.menu.property_menu,menu);
&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//http://www.mysamplecode.com/2012/11/android-expandablelistview-search.html&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;      &lt;/span&gt;MenuItem searchItem = menu.findItem(R.id.menu_search);
        searchView = (SearchView) searchItem.getActionView();



        SearchManager searchManager =
                (SearchManager) getSystemService(Context.SEARCH_SERVICE);
        SearchView searchView =
                (SearchView) menu.findItem(R.id.menu_search).getActionView();
        searchView.setSearchableInfo(
                searchManager.getSearchableInfo(getComponentName()));

        searchView.setOnFocusChangeListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;OnFocusChangeListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;onFocusChange(View v, &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;boolean &lt;/span&gt;hasFocus) {


                Toast.makeText(getApplicationContext(),&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;back clicked&quot;&lt;/span&gt;,Toast.LENGTH_LONG).show();
            }
        });

        searchView.setOnClickListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;OnClickListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;onClick(View v) {
                Toast.makeText(getApplicationContext(),&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;back clicked&quot;&lt;/span&gt;,Toast.LENGTH_LONG).show();
                Log.d(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;************************************searchView**&quot;&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;-----&quot;&lt;/span&gt;);

            }
        });



        searchView.setOnSearchClickListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;OnClickListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public void &lt;/span&gt;onClick(View v) {
                Toast.makeText(getApplicationContext(),&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;back search&quot;&lt;/span&gt;,Toast.LENGTH_LONG).show();
                &lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;//setItemsVisibility(menu, searchItem, false);&lt;/span&gt;&lt;span style=&quot;color: grey; font-style: italic;&quot;&gt;                &lt;/span&gt;textview_property.setVisibility(View.GONE);
            }
        });


        searchView.setOnCloseListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;OnCloseListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public boolean &lt;/span&gt;onClose() {
                textview_property.setVisibility(View.VISIBLE);
                Toast.makeText(getApplicationContext(),&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;back close&quot;&lt;/span&gt;,Toast.LENGTH_LONG).show();
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return false&lt;/span&gt;;
            }
        });


        searchView.setOnQueryTextListener(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;OnQueryTextListener() {
            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public boolean &lt;/span&gt;onQueryTextSubmit(String query) {
                Log.d(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;*********************************&quot;&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;------&quot;&lt;/span&gt;+query);

                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;null &lt;/span&gt;!= arrayList || arrayList.size() &amp;gt; &lt;span style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;){
                    adapter=&lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;new &lt;/span&gt;PropertyAdapter(getApplicationContext());
                    listView.setAdapter(adapter);
                    adapter.getFilter().filter(query);
                }

                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return false&lt;/span&gt;;
            }

            @Override
            &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;public boolean &lt;/span&gt;onQueryTextChange(String newText) {
                Log.d(&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;*********************************&quot;&lt;/span&gt;,&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;&quot;------&quot;&lt;/span&gt;+newText);
                &lt;span style=&quot;color: navy; font-weight: bold;&quot;&gt;return false&lt;/span&gt;;
            }
        });&lt;/pre&gt;
&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; font-family: &amp;quot;Courier New&amp;quot;; font-size: 9pt;&quot;&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/3525467478938698452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2016/11/android-searchview-expand-hide-toolbar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/3525467478938698452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/3525467478938698452'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2016/11/android-searchview-expand-hide-toolbar.html' title='Android searchview expand hide Toolbar title'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-976292020265515516</id><published>2016-10-22T01:00:00.000-07:00</published><updated>2016-10-22T01:00:07.444-07:00</updated><title type='text'>HttpUrlconnection in different method </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px;&quot;&gt;
To perform an HTTP PUT:&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;URL url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;http://www.example.com/resource&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; httpCon &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoOutput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;PUT&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;OutputStreamWriter&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; out &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;OutputStreamWriter&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Resource content&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px;&quot;&gt;
To perform an HTTP DELETE:&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;URL url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;http://www.example.com/resource&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; httpCon &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoOutput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;DELETE&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
httpCon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&lt;div class=&quot;post-text&quot; itemprop=&quot;text&quot; style=&quot;background-color: white; border: 0px; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; line-height: 1.3; margin: 0px 0px 5px; padding: 0px; white-space: normal; width: 660px; word-wrap: break-word;&quot;&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; getHttpConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        URL uri &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; con &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            uri &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; uri&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;//type: POST, PUT, DELETE, GET&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoOutput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoInput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setConnectTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;60000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;//60 secs&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setReadTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;60000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;//60 secs&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Accept-Encoding&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Your Encoding&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Your Encoding&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            logger&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;connection i/o failed&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;


        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
Then in your code :&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; yourmethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; reqbody&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; con &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; result &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        con &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; conUtil&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getHttpConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;//you can add any request body here if you want to post&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; reqbody &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;  
                con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoInput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoOutput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; out &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;writeBytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;reqbody&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;flush&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

            &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;BufferedReader&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; in &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;BufferedReader&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;InputStreamReader&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;con&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;()));&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; temp &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; sb &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;temp &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; in&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;readLine&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            sb&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;temp&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        result &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; sb&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        in&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;// TODO Auto-generated catch block&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        logger&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;//result is the response you get from the remote side&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; margin-bottom: 1em; padding: 0px;&quot;&gt;
PUT&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;URL url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
   url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;http://localhost:8080/putservice&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;MalformedURLException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; dataOutputStream &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;PUT&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoInput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoOutput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    dataOutputStream &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    dataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;dataOutputStream &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            dataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;flush&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            dataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpsURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        httpsURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; margin-bottom: 1em; padding: 0px;&quot;&gt;
DELETE&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;URL url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;http://localhost:8080/deleteservice&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;MalformedURLException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;DELETE&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getResponseCode&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;         
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px; white-space: normal;&quot;&gt;
&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;&quot;&gt;PUT&lt;/code&gt;&amp;nbsp;example using&amp;nbsp;&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;&quot;&gt;HttpURLConnection&lt;/code&gt;:&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;URL url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
   url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;http://localhost:8080/putservice&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;MalformedURLException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; dataOutputStream &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;PUT&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoInput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setDoOutput&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    dataOutputStream &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    dataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;dataOutputStream &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            dataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;flush&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            dataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpsURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        httpsURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px; white-space: normal;&quot;&gt;
&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;&quot;&gt;DELETE&lt;/code&gt;&amp;nbsp;example using&amp;nbsp;&lt;code style=&quot;background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 1px 5px; white-space: pre-wrap;&quot;&gt;HttpURLConnection&lt;/code&gt;:&lt;/div&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;URL url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    url &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; URL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;http://localhost:8080/deleteservice&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;MalformedURLException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;HttpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;openConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestProperty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
                &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;application/x-www-form-urlencoded&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;setRequestMethod&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;DELETE&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getResponseCode&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    exception&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;finally&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;         
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;httpURLConnection &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
        httpURLConnection&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;disconnect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-java prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/976292020265515516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2016/10/httpurlconnection-in-different-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/976292020265515516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/976292020265515516'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2016/10/httpurlconnection-in-different-method.html' title='HttpUrlconnection in different method '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-8198311284226904118</id><published>2016-10-10T01:47:00.004-07:00</published><updated>2016-10-10T01:47:26.297-07:00</updated><title type='text'>How to import a library project in Android Studio?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: #fafafa; color: #5a5a5a; font-family: Roboto; font-size: 15px; margin-bottom: 10px;&quot;&gt;
In this short tutorial I would show you how to import a library project in&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/studio/index.html&quot; style=&quot;color: #0088cc; text-decoration: none; transition-duration: 0.15s; transition-property: border, background, color; transition-timing-function: ease-in-out;&quot; target=&quot;_blank&quot; title=&quot;Android Stidio&quot;&gt;Android Studio&lt;/a&gt;&lt;span class=&quot;tc-external&quot;&gt;&lt;/span&gt;&amp;nbsp;v1.2.1.1. The steps to do so are:&lt;/div&gt;
&lt;ol style=&quot;background-color: #fafafa; color: #5a5a5a; font-family: Roboto; font-size: 15px; margin: 0px 0px 10px 25px; padding: 0px 5px;&quot;&gt;
&lt;li class=&quot;&quot; style=&quot;line-height: 20px;&quot;&gt;Goto File -&amp;gt; New -&amp;gt; Import Module.&lt;img alt=&quot;Android Studio Add Library&quot; class=&quot;aligncenter size-full wp-image-1256 tc-smart-loaded&quot; height=&quot;137&quot; sizes=&quot;(max-width: 455px) 100vw, 455px&quot; src=&quot;https://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-1.jpg&quot; srcset=&quot;http://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-1.jpg 455w, http://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-1-300x90.jpg 300w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 0.857143rem auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;455&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;Source Directory -&amp;gt; Browse the project path.&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;line-height: 20px;&quot;&gt;Specify the Module Name – it is used for internal project reference.&lt;img alt=&quot;Android Studio Add Library - 2&quot; class=&quot;aligncenter wp-image-801 size-full tc-smart-loaded&quot; height=&quot;321&quot; src=&quot;https://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-2-e1423220429151.png&quot; style=&quot;border: 0px; display: block; height: auto; margin: 0.857143rem auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;500&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;Let Android Studio build the project.&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;Open build.gradle (Module:app) file.&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;Add the following line with your module name in place of “&lt;em&gt;Volley&lt;/em&gt;” in the dependencies block:&lt;br /&gt;&lt;div class=&quot;crayon-syntax crayon-theme-arduino-ide crayon-font-courier-new crayon-os-pc print-yes notranslate&quot; data-settings=&quot; minimize scroll-mouseover&quot; id=&quot;crayon-57fb43f0e1b17510606954&quot; style=&quot;background: rgb(253, 253, 253) !important; border-color: rgb(221, 221, 221) !important; border-style: solid !important; border-width: 1px !important; box-sizing: border-box; direction: ltr !important; font-family: Monaco, MonacoRegular, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px !important; height: auto; line-height: 15px !important; margin: 12px 0px; overflow: hidden !important; padding: 0px; position: relative !important; text-shadow: none !important; text-size-adjust: none; width: 835px;&quot;&gt;
&lt;div class=&quot;crayon-toolbar&quot; data-settings=&quot; show&quot; style=&quot;background: rgb(238, 238, 238) !important; border-bottom: 1px solid rgb(221, 221, 221) !important; border-image: initial; border-left: 0px; border-right: 0px; border-top: 0px; font-family: &amp;quot;Courier New&amp;quot;, monospace !important; height: 18px !important; line-height: 18px !important; margin: 0px; overflow: hidden; padding: 0px; position: relative; width: 833px; z-index: 4;&quot;&gt;
&lt;span class=&quot;crayon-title&quot; style=&quot;color: rgb(153 , 153 , 153); float: left; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; padding: 0px 4px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;crayon-tools&quot; style=&quot;background: 0px center; border: 0px; float: right !important; font-family: inherit; font-weight: inherit !important; height: 18px !important; line-height: 18px !important; margin: 0px; padding: 0px; position: absolute; right: 0px;&quot;&gt;
&lt;div class=&quot;crayon-button crayon-nums-button crayon-pressed&quot; style=&quot;background: -24px 0px no-repeat; border: 0px; display: inline; float: left !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: 15px; margin: 0px; padding: 0px; position: relative; width: 24px;&quot; title=&quot;Toggle Line Numbers&quot;&gt;
&lt;div class=&quot;crayon-button-icon&quot; style=&quot;background: url(&amp;quot;../images/toolbar/buttons.png&amp;quot;) -24px -32px; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: 16px !important; left: 0px; line-height: inherit !important; margin: -8px 0px 0px; padding: 0px; position: absolute; top: 9px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;crayon-button crayon-plain-button&quot; style=&quot;background: 0px center no-repeat; border: 0px; display: inline; float: left !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: 15px; margin: 0px; padding: 0px; position: relative; width: 24px;&quot; title=&quot;Toggle Plain Code&quot;&gt;
&lt;div class=&quot;crayon-button-icon&quot; style=&quot;background: url(&amp;quot;../images/toolbar/buttons.png&amp;quot;) 0px -48px; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: 16px !important; left: 0px; line-height: inherit !important; margin: -8px 0px 0px; padding: 0px; position: absolute; top: 9px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;crayon-button crayon-wrap-button&quot; style=&quot;background: 0px center no-repeat; border: 0px; display: inline; float: left !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: 15px; margin: 0px; padding: 0px; position: relative; width: 24px;&quot; title=&quot;Toggle Line Wrap&quot;&gt;
&lt;div class=&quot;crayon-button-icon&quot; style=&quot;background: url(&amp;quot;../images/toolbar/buttons.png&amp;quot;) 0px -112px; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: 16px !important; left: 0px; line-height: inherit !important; margin: -8px 0px 0px; padding: 0px; position: absolute; top: 9px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;crayon-button crayon-copy-button&quot; style=&quot;background: 0px center no-repeat; border: 0px; display: inline; float: left !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: 15px; margin: 0px; padding: 0px; position: relative; width: 24px;&quot; title=&quot;Copy&quot;&gt;
&lt;div class=&quot;crayon-button-icon&quot; style=&quot;background: url(&amp;quot;../images/toolbar/buttons.png&amp;quot;) 0px -16px; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: 16px !important; left: 0px; line-height: inherit !important; margin: -8px 0px 0px; padding: 0px; position: absolute; top: 9px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;crayon-button crayon-popup-button&quot; style=&quot;background: 0px center no-repeat; border: 0px; display: inline; float: left !important; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: 15px; margin: 0px; padding: 0px; position: relative; width: 24px;&quot; title=&quot;Open Code In New Window&quot;&gt;
&lt;div class=&quot;crayon-button-icon&quot; style=&quot;background: url(&amp;quot;../images/toolbar/buttons.png&amp;quot;) 0px 0px; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: 16px !important; left: 0px; line-height: inherit !important; margin: -8px 0px 0px; padding: 0px; position: absolute; top: 9px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;crayon-plain-wrap&quot; style=&quot;background: 0px center; border: 0px; font-family: &amp;quot;Courier New&amp;quot;, monospace !important; height: auto !important; margin: 0px !important; padding: 0px !important;&quot;&gt;
&lt;textarea class=&quot;crayon-plain print-no&quot; data-settings=&quot;dblclick&quot; readonly=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-color: initial; border-radius: 0px; border-style: initial; border-width: 0px; box-shadow: none; color: black; cursor: not-allowed; font-family: &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px !important; height: 34px; line-height: 15px !important; margin: 0px; opacity: 0; overflow: hidden; padding-left: 5px; padding-right: 5px; padding-top: 0px; position: absolute; resize: none; tab-size: 4; transition: border 0.2s linear, box-shadow 0.2s linear; vertical-align: middle; white-space: pre; width: 833px; word-wrap: normal; z-index: 0;&quot; wrap=&quot;soft&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;
&lt;div class=&quot;crayon-main&quot; style=&quot;background: 0px center; border: 0px; font-family: &amp;quot;Courier New&amp;quot;, monospace !important; margin: 0px; overflow: hidden; padding: 0px; position: relative; width: 833px; z-index: 1;&quot;&gt;
&lt;table class=&quot;crayon-table&quot; style=&quot;background: none !important; border-collapse: collapse !important; border-spacing: 0px !important; border: none !important; font-size: 12px; line-height: 2; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px !important; margin-top: 0px !important; max-width: 100%; padding: 0px !important; table-layout: auto !important; width: auto !important;&quot;&gt;&lt;tbody&gt;
&lt;tr class=&quot;crayon-row&quot; style=&quot;background: 0px center; border: none !important; margin: 0px !important; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;td class=&quot;crayon-nums &quot; data-settings=&quot;show&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: initial !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border: 0px; color: rgb(212, 212, 212) !important; margin: 0px !important; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;div class=&quot;crayon-nums-content&quot; style=&quot;background: 0px center; border: 0px; line-height: 15px !important; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;
&lt;div class=&quot;crayon-num&quot; data-line=&quot;crayon-57fb43f0e1b17510606954-1&quot; style=&quot;background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;&quot;&gt;
1&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;crayon-code&quot; style=&quot;background: 0px center; border: 0px; margin: 0px !important; padding: 0px !important; vertical-align: top !important; width: 816px;&quot;&gt;&lt;div class=&quot;crayon-pre&quot; style=&quot;background: none !important; border: none !important; line-height: 15px !important; margin: 0px; overflow: visible; padding: 0px; tab-size: 4; white-space: pre;&quot;&gt;
&lt;div class=&quot;crayon-line&quot; id=&quot;crayon-57fb43f0e1b17510606954-1&quot; style=&quot;background: 0px center; border: 0px; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px;&quot;&gt;
&lt;span class=&quot;crayon-e&quot; style=&quot;color: rgb(204 , 102 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;&quot;&gt;compile &lt;/span&gt;&lt;span class=&quot;crayon-e&quot; style=&quot;color: rgb(204 , 102 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;&quot;&gt;project&lt;/span&gt;&lt;span class=&quot;crayon-sy&quot; style=&quot;color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;crayon-s&quot; style=&quot;color: rgb(0 , 102 , 153); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;&quot;&gt;&#39;:Volley&#39;&lt;/span&gt;&lt;span class=&quot;crayon-sy&quot; style=&quot;color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;line-height: 20px;&quot;&gt;It should look something like this:&lt;img alt=&quot;Android Studio Add Library 3&quot; class=&quot;aligncenter size-full wp-image-803 tc-smart-loaded&quot; height=&quot;161&quot; sizes=&quot;(max-width: 453px) 100vw, 453px&quot; src=&quot;https://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-3.png&quot; srcset=&quot;http://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-3.png 453w, http://www.truiton.com/wp-content/uploads/2015/02/Android-Studio-Add-Library-3-300x107.png 300w&quot; style=&quot;border: 0px; display: block; height: auto; margin: 0.857143rem auto; max-width: 100%; vertical-align: middle;&quot; width=&quot;453&quot; /&gt;&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;After this Android Studio would start saying “gradle files have changed since last project sync”, press the “sync now” link to start a sync.&lt;/li&gt;
&lt;li style=&quot;line-height: 20px;&quot;&gt;That’s all you need to do.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;color: #5a5a5a; font-family: &amp;quot;roboto&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #5a5a5a; font-family: &amp;quot;roboto&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;reference&amp;nbsp;of&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #5a5a5a; font-family: &amp;quot;roboto&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;a href=&quot;http://www.truiton.com/2015/02/android-studio-add-library-project/&quot;&gt;http://www.truiton.com/2015/02/android-studio-add-library-project/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/8198311284226904118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2016/10/how-to-import-library-project-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8198311284226904118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8198311284226904118'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2016/10/how-to-import-library-project-in.html' title='How to import a library project in Android Studio?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-2825444739880682169</id><published>2016-09-27T03:34:00.001-07:00</published><updated>2016-09-27T03:34:59.774-07:00</updated><title type='text'>TabLayout (Android Design Library) Text Color</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;!-- Base application theme. --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;AppTheme&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;Theme.AppCompat.Light.DarkActionBar&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; Below will reference with our custom style &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;--&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;item name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;android:textAppearance&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;my_tab_text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;my_tab_text&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;parent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;Base.TextAppearance.AppCompat&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;item name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;android:textColor&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;@&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;holo_blue_dark&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px;&quot;&gt;
And&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;if you dont want to reference from your Apptheme&lt;/strong&gt;&amp;nbsp;you can directly specify to TabLayout using Below snippet.&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;android.support.design.widget.TabLayout&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;app:tabTextAppearance&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;@style/my_tab_text&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;app:tabIndicatorHeight&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;48dp&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/2825444739880682169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2016/09/tablayout-android-design-library-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/2825444739880682169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/2825444739880682169'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2016/09/tablayout-android-design-library-text.html' title='TabLayout (Android Design Library) Text Color'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-1854264526598241328</id><published>2016-09-23T03:42:00.000-07:00</published><updated>2016-09-23T03:42:34.679-07:00</updated><title type='text'>Android google map zooming and running the current location</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;uses-permission&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;android.permission.ACCESS_FINE_LOCATION&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;uses-permission&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;android.permission.ACCESS_COARSE_LOCATION&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eff0f1; border: 0px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;package&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;example&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationListener&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;os&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;view&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;actionbarsherlock&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;SherlockFragmentActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;maps&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;CameraUpdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;maps&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;CameraUpdateFactory&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;maps&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;GoogleMap&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;maps&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;SupportMapFragment&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;maps&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LatLng&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;SherlockFragmentActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;implements&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationListener&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;     &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;GoogleMap&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; map&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationManager&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; locationManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; MIN_TIME &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; MIN_DISTANCE &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    setContentView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    map &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;SupportMapFragment&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; getSupportFragmentManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;findFragmentById&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)).&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getMap&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

    locationManager &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; getSystemService&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Context&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;LOCATION_SERVICE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    locationManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;requestLocationUpdates&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LocationManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;NETWORK_PROVIDER&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; MIN_TIME&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; MIN_DISTANCE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: #858c93; margin: 0px; padding: 0px;&quot;&gt;//You can also use LocationManager.GPS_PROVIDER and LocationManager.PASSIVE_PROVIDER        &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; onLocationChanged&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Location&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LatLng&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; latLng &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;LatLng&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getLatitude&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; location&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;getLongitude&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;CameraUpdate&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; cameraUpdate &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;CameraUpdateFactory&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;newLatLngZoom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;latLng&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    map&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;animateCamera&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;cameraUpdate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
    locationManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;removeUpdates&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; onStatusChanged&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; provider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; status&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; extras&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; onProviderEnabled&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; provider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: #101094; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; onProviderDisabled&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; provider&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px; white-space: normal;&quot;&gt;
map.xml&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; white-space: inherit; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;xml version&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; encoding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;fragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;@+id/map&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;border: 0px; color: #e64320; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;border: 0px; color: #0f74bd; margin: 0px; padding: 0px;&quot;&gt;&quot;com.google.android.gms.maps.SupportMapFragment&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; white-space: inherit; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;if you need zooming effect very close &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #7d2727; font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif;&quot;&gt;LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
  
/*   CameraPosition cameraPosition = new CameraPosition.Builder()
      .target(latLng).zoom(19f).tilt(70).build();
   googleMap.setMyLocationEnabled(true);
      googleMap.animateCamera(CameraUpdateFactory
              .newCameraPosition(cameraPosition));*/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; white-space: inherit; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; white-space: inherit; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; white-space: inherit; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;border: 0px; color: #7d2727; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: #303336; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/1854264526598241328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2016/09/android-google-map-zooming-and-running.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/1854264526598241328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/1854264526598241328'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2016/09/android-google-map-zooming-and-running.html' title='Android google map zooming and running the current location'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-5962103155646288797</id><published>2016-07-19T02:57:00.001-07:00</published><updated>2016-07-19T04:48:38.467-07:00</updated><title type='text'>Custom Kestore to upload signed APK for Playstore using SHA1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Usually when &amp;nbsp;create the google map it will run proper in locally after setting google key ,package name and SHA1 certificate fingerprint&lt;br /&gt;
&lt;br /&gt;
when upload the APK to play store we have to create custom keystore, then only we will be able to upload playstore&lt;br /&gt;
&amp;nbsp;here when change the keystore default into custom obviously SHA1 fingerprint also will get changed&lt;br /&gt;
so we have to try change in eclipse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
here or we can try&lt;br /&gt;
&lt;br /&gt;
C:\Users\**********&amp;gt;keytool -list -keystore D:\APK\Keystore\oneapp.keystore&lt;br /&gt;
Enter keystore password:&lt;br /&gt;
&lt;br /&gt;
Keystore type: JKS&lt;br /&gt;
Keystore provider: SUN&lt;br /&gt;
&lt;br /&gt;
Your keystore contains 1 entry&lt;br /&gt;
&lt;br /&gt;
oneapp, Jul 19, 2016, PrivateKeyEntry,&lt;br /&gt;
Certificate fingerprint (SHA1): CF:64:96:E5:A9:F9:EF:70:6F:7D:18:2B:54:36:E5:7D:&lt;br /&gt;
A8:5F:7A:99&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;background: none rgb(234, 219, 196) !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: &amp;quot;Courier New&amp;quot;; font-size: 14px; font-stretch: inherit; height: auto !important; left: auto !important; line-height: 15.4px; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOuLXVWL66qdFIeezHsSVC8dAfZtnu-5YaJ_2-YNi14YBE7B661eof9d1pjeXM2G0frfj6pE4uHMTJSLhfWRqqkEnPZKJaNrtraxl6DD2466K6e9Rie-UsYygaiPZqBIKhv7WRjwUFcG2E/s1600/eclipse.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;459&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOuLXVWL66qdFIeezHsSVC8dAfZtnu-5YaJ_2-YNi14YBE7B661eof9d1pjeXM2G0frfj6pE4uHMTJSLhfWRqqkEnPZKJaNrtraxl6DD2466K6e9Rie-UsYygaiPZqBIKhv7WRjwUFcG2E/s640/eclipse.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;There is other way of doing as follow here&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;post-text&quot; itemprop=&quot;text&quot; style=&quot;background-color: white; border: 0px; color: #242729; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; line-height: 1.3; margin: 0px 0px 5px; padding: 0px; width: 660px; word-wrap: break-word;&quot;&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
Steps (for ADT):&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
1.Export any project (It will show you an option to create custom keystore).&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;img alt=&quot;enter image description here&quot; src=&quot;http://i.stack.imgur.com/yLj4E.png&quot; style=&quot;border: 0px; margin: 0px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
create your keystore with an extention &quot;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;.keystore&lt;/strong&gt;&quot; and give password android and press next.&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
2.&lt;img alt=&quot;enter image description here&quot; src=&quot;http://i.stack.imgur.com/1SG6e.png&quot; style=&quot;border: 0px; margin: 0px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
give alias name =&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;androiddebugkey&lt;/strong&gt;&amp;nbsp;and password =&amp;nbsp;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;android&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
now press finish and your keystore is ready.&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
1.Go to windows -&amp;gt; preference&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
and give the path of your custom keystore file&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;img alt=&quot;enter image description here&quot; src=&quot;http://i.stack.imgur.com/ELbca.png&quot; style=&quot;border: 0px; margin: 0px; max-width: 100%; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/5962103155646288797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2016/07/custom-kestore-to-upload-signed-apk-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/5962103155646288797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/5962103155646288797'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2016/07/custom-kestore-to-upload-signed-apk-for.html' title='Custom Kestore to upload signed APK for Playstore using SHA1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOuLXVWL66qdFIeezHsSVC8dAfZtnu-5YaJ_2-YNi14YBE7B661eof9d1pjeXM2G0frfj6pE4uHMTJSLhfWRqqkEnPZKJaNrtraxl6DD2466K6e9Rie-UsYygaiPZqBIKhv7WRjwUFcG2E/s72-c/eclipse.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-7235386526365585098</id><published>2015-12-07T01:35:00.003-08:00</published><updated>2015-12-07T01:35:51.119-08:00</updated><title type='text'>Android/SCREEN ON, SCREEN OFF BroadcastReceiver </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;class&lt;/span&gt; MyApplication &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;extends&lt;/span&gt; Application &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kw3&quot; style=&quot;color: #003399; font-family: &#39;Courier New&#39;;&quot;&gt;String&lt;/span&gt; TAG &lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&quot;SCREEN&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;private&lt;/span&gt; BroadcastReceiver scrOnReceiver&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;private&lt;/span&gt; BroadcastReceiver scrOffReceiver&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;private&lt;/span&gt; IntentFilter scrOnFilter&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;private&lt;/span&gt; IntentFilter scrOffFilter&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    @Override
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;void&lt;/span&gt; onCreate&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;super&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633; font-family: &#39;Courier New&#39;;&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        scrOnReceiver &lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;new&lt;/span&gt; BroadcastReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt; 
            @Override 
            &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;void&lt;/span&gt; onReceive&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: #003399; font-family: &#39;Courier New&#39;;&quot;&gt;Context&lt;/span&gt; context, Intent intent&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt; 
                Log.&lt;span class=&quot;me1&quot; style=&quot;color: #006633; font-family: &#39;Courier New&#39;;&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;TAG, &lt;span class=&quot;st0&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&quot;SCREEN ON&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;  timer.cancel();
            &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt; 
        &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        scrOnFilter &lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;new&lt;/span&gt; IntentFilter&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;Intent.&lt;span class=&quot;me1&quot; style=&quot;color: #006633; font-family: &#39;Courier New&#39;;&quot;&gt;ACTION_SCREEN_ON&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt; 
&amp;nbsp;
        scrOffReceiver &lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;new&lt;/span&gt; BroadcastReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;
            @Override
            &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;void&lt;/span&gt; onReceive&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;color: #003399; font-family: &#39;Courier New&#39;;&quot;&gt;Context&lt;/span&gt; context, Intent intent&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;
                Log.&lt;span class=&quot;me1&quot; style=&quot;color: #006633; font-family: &#39;Courier New&#39;;&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;TAG, &lt;span class=&quot;st0&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;;&quot;&gt;&quot;SCREEN OFF&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;  timer.start();
            &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        scrOffFilter &lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;new&lt;/span&gt; IntentFilter&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;Intent.&lt;span class=&quot;me1&quot; style=&quot;color: #006633; font-family: &#39;Courier New&#39;;&quot;&gt;ACTION_SCREEN_OFF&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        registerReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;scrOnReceiver, scrOnFilter&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
        registerReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;scrOffReceiver, scrOffFilter&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;//time counting&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt; CountDownTimer timer = new CountDownTimer(1*60*1000, 1000) {

        public void onTick(long millisUntilFinished) {
           //Some code
         Log.d(&quot;timer&quot;, &quot;--&quot;+millisUntilFinished);
         
        }

        public void onFinish() {
           //Logout
         Intent intent=new Intent(AppController.this,LoginActivity.class);
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

         Log.d(&quot;***********&quot;, &quot;logout&quot;);
        }
     };
&amp;nbsp;
    @Override
    &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw4&quot; style=&quot;color: #000066; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;void&lt;/span&gt; onTerminate&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kw1&quot; style=&quot;color: darkred; font-family: &#39;Courier New&#39;; font-weight: bold;&quot;&gt;super&lt;/span&gt;.&lt;span class=&quot;me1&quot; style=&quot;color: #006633; font-family: &#39;Courier New&#39;;&quot;&gt;onTerminate&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        unregisterReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;scrOnReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
        unregisterReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;(&lt;/span&gt;scrOffReceiver&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;color: #339933; font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;&lt;pre class=&quot;de1&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px none white; color: black; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;uses-sdk&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:minSdkVersion&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;8&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:targetSdkVersion&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;17&quot;&lt;/span&gt; &lt;span class=&quot;re2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;application&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:name&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;.MyApplication&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:allowBackup&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:icon&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:label&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;        &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:theme&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;@style/AppTheme&quot;&lt;/span&gt; &lt;span class=&quot;re2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;activity&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;            &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:name&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;            &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:label&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt; &lt;span class=&quot;re2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;intent-filter&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;action&lt;/span&gt; &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:name&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;android.intent.action.MAIN&quot;&lt;/span&gt; &lt;span class=&quot;re2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
                &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;category&lt;/span&gt; &lt;span class=&quot;re0&quot; style=&quot;color: #000066;&quot;&gt;android:name&lt;/span&gt;=&lt;span class=&quot;st0&quot; style=&quot;color: red;&quot;&gt;&quot;android.intent.category.LAUNCHER&quot;&lt;/span&gt; &lt;span class=&quot;re2&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
            &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;/intent-filter&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;/activity&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
   &lt;span class=&quot;sc3&quot; style=&quot;color: #009900; font-family: &#39;맑은 고딕&#39;;&quot;&gt;&lt;span class=&quot;re1&quot; style=&quot;color: black; font-weight: bold;&quot;&gt;&amp;lt;/application&lt;span class=&quot;re2&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;de1&quot; style=&quot;background: none rgb(249, 249, 249); border: 0px none white; font-size: 12.8px; font-stretch: normal; line-height: 1.2em; padding: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;br0&quot; style=&quot;color: #009900; font-family: &#39;Courier New&#39;;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/7235386526365585098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/12/androidscreen-on-screen-off.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/7235386526365585098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/7235386526365585098'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/12/androidscreen-on-screen-off.html' title='Android/SCREEN ON, SCREEN OFF BroadcastReceiver '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-4228949535061933689</id><published>2015-11-24T20:49:00.001-08:00</published><updated>2015-11-24T20:49:35.829-08:00</updated><title type='text'>Android application logout after 15 min</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here i just made the code the application should come out when it is not used till 15 minutes&lt;br /&gt;
&lt;br /&gt;
for counting i have taken counter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;CountDownTimer timer = new CountDownTimer(15 *60 * 1000, 1000) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onTick(long millisUntilFinished) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Some code&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Log.d(&quot;timer&quot;, &quot;--&quot;+millisUntilFinished);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onFinish() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Logout&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;finish();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Log.d(&quot;***********&quot;, &quot;logout&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
then i just calling the timer when it goes to sleep&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;protected void onPause() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;super.onPause();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(&quot;***********&quot;, &quot;onPause&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;timer.start();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
meanwhile if the application started again it means like resume, it should cancel&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;@Override
  protected void onResume()&lt;br /&gt;
{
   Log.d(&quot;***********&quot;, &quot;onresume&quot;);&lt;br /&gt;
&amp;nbsp;super.onResume();
   timer.cancel();&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/4228949535061933689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/11/android-application-logout-after-15-min.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/4228949535061933689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/4228949535061933689'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/11/android-application-logout-after-15-min.html' title='Android application logout after 15 min'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-4146739521302510949</id><published>2015-11-18T01:19:00.001-08:00</published><updated>2015-11-18T01:19:24.613-08:00</updated><title type='text'>Android set image in imageview from mysql blob</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background: none rgb(248, 248, 248) !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;&lt;b&gt;php code for getting blob type from databse&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;$product[&quot;description&quot;] = $row[&quot;description&quot;];&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$product[&quot;before_tuning_graph&quot;] = base64_encode($row[&#39;before_tuning_graph&#39;]);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-image-outset: initial !important; border-image-repeat: initial !important; border-image-slice: initial !important; border-image-source: initial !important; border-image-width: initial !important; border: 0px !important; bottom: auto !important; direction: ltr !important; float: none !important; height: auto !important; left: auto !important; list-style: none; margin: 0px !important; outline: 0px !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: 15px; line-height: 16.5px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$product[&quot;after_tuning_graph&quot;] = base64_encode($row[&#39;after_tuning_graph&#39;]);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;b&gt;In java&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;b&gt;read the blob images as string&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 15px; line-height: 16.5px;&quot;&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
//setting image for before tuning&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try {&lt;/div&gt;
&lt;div&gt;
byte[] res1 = Base64.decode(arrayList.get(position).getBefore_tuning_graph(), 0);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; InputStream ins =new ByteArrayInputStream(res1);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; Drawable dUser = Drawable.createFromStream(ins , &quot;immagine&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; imageViewBefore.setImageDrawable(dUser);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;} catch (Exception e) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;e.printStackTrace();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/4146739521302510949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/11/android-set-image-in-imageview-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/4146739521302510949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/4146739521302510949'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/11/android-set-image-in-imageview-from.html' title='Android set image in imageview from mysql blob'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-6872989593834316918</id><published>2015-11-11T01:49:00.001-08:00</published><updated>2015-11-11T01:49:46.990-08:00</updated><title type='text'>Store ArrayList in android SharedPreference</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;ArrayList&amp;lt;String&amp;gt; myArrayList=new ArrayList&amp;lt;String&amp;gt;();&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;myArrayList.add(&quot;value1&quot;);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;myArrayList.add(&quot;value2&quot;);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;myArrayList.add(&quot;value3&quot;);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;myArrayList.add(&quot;value4&quot;);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;myArrayList.add(&quot;value5&quot;);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;myArrayList.add(&quot;value6&quot;);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;b style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;Store arraylist in sharedpreference&lt;/b&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;b style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;SharedPreference sPrefs=PreferenceManager.getDefaultSharedPreferences(context);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;SharedPreference.Editor sEdit=sPrefs.edit();&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;for(int i=0;i&amp;lt;myArrayList.size();i++)&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sEdit.putString(&quot;val&quot;+i,myArrayList.get(i);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;&amp;nbsp;sEdit.putInt(&quot;size&quot;,myArrayList.size());&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;&amp;nbsp;sEdit.commit();&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;b style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;Retrive arraylist from sharedpreference&lt;/b&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;b style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;I am retriving values in another arraylist&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;ArrayList&amp;lt;String&amp;gt; myAList=new ArrayList&amp;lt;String&amp;gt;();&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;int size=sPrefs.getInt(&quot;size&quot;,0);&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;for(int j=0;j&amp;lt;size;j++)&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myAList.add(sPrefs.getString(&quot;val&quot;+j));&lt;/span&gt;&lt;br style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot; /&gt;&lt;span style=&quot;background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/6872989593834316918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/11/store-arraylist-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6872989593834316918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6872989593834316918'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/11/store-arraylist-in-android.html' title='Store ArrayList in android SharedPreference'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-6079304383905511756</id><published>2015-11-09T03:22:00.001-08:00</published><updated>2015-11-09T03:22:51.320-08:00</updated><title type='text'>AdMob for Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;devsite-expand-section-nav-container&quot; style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 0px; padding: 0px;&quot;&gt;
&lt;h1 class=&quot;devsite-page-title&quot; itemprop=&quot;name&quot; style=&quot;box-sizing: inherit; color: #757575; font-size: 34px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 40px; margin: 0px 0px 20px; overflow: hidden; padding: 0px; position: relative; text-overflow: ellipsis; top: -4px;&quot;&gt;
Get Started in Eclipse&lt;/h1&gt;
&lt;/div&gt;
&lt;div class=&quot;devsite-article-body clearfix&quot; itemprop=&quot;articleBody&quot; style=&quot;box-sizing: inherit; color: #212121; font-family: Roboto, sans-serif; font-size: 16px; line-height: 24px; margin: 0px; padding: 0px;&quot;&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
This guide will show you how to use Eclipse to integrate the Google Mobile Ads SDK into a brand new app and display a simple banner ad. It should take about thirty minutes to complete and will give you a good sense of how the SDK functions within an app.&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
The ad unit and samples that we provide return test ads. Test ads are always available, even if your account is suspended or disabled. For more information, review the&amp;nbsp;&lt;a href=&quot;https://support.google.com/admob/answer/2753860&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;AdMob policies&lt;/a&gt;&amp;nbsp;and learn more about&amp;nbsp;&lt;a href=&quot;https://support.google.com/admob/answer/3342054&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;invalid activity&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;note&quot; style=&quot;background: rgb(117, 117, 117); box-sizing: inherit; color: white; font-size: 14px; margin-bottom: 16px; margin-top: 16px; padding: 24px 24px 24px 72px;&quot;&gt;
Using live ads during development is against AdMob policy; if you test on live ads, your AdMob account may be suspended.&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
The guide is intended for developers who are familiar with Eclipse and have already used it to create Android apps. If you&#39;re new to Android coding, consider getting started with&amp;nbsp;&lt;a href=&quot;https://developers.google.com/admob/android/quick-start.html&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;Android Studio&lt;/a&gt;. It&#39;s the official IDE for Android development.&lt;/div&gt;
&lt;div class=&quot;special&quot; style=&quot;background: rgb(3, 155, 229); box-sizing: inherit; color: white; font-size: 14px; margin-bottom: 16px; margin-top: 16px; padding: 24px 24px 24px 72px;&quot;&gt;
No two developers have the same level of experience, so we&#39;ve added occasional notes like this one for those who would like a little extra info. If you&#39;re an expert Android developer, feel free to skip them.&lt;/div&gt;
&lt;h2 id=&quot;prerequisites&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Prerequisites&lt;/h2&gt;
&lt;ul style=&quot;box-sizing: inherit; list-style-position: outside; margin: 0px; padding-left: 40px;&quot;&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;Running Eclipse 3.7.2 (Indigo) or later&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;Eclipse JDT plugin (included in most Eclipse IDE packages)&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;The&amp;nbsp;&lt;a href=&quot;https://developer.android.com/sdk/installing/installing-adt.html&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;Android Plugin for Eclipse&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;The&amp;nbsp;&lt;a href=&quot;https://developer.android.com/sdk/index.html#Other&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;Android SDK Tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;creating_a_new_project&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Creating a new project&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
In this step, we&#39;ll create a brand new project in Eclipse to use for our example. Open eclipse with an empty workspace and choose&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;File &amp;gt; New &amp;gt; Project...&lt;/strong&gt;&amp;nbsp;from the menu.&lt;/div&gt;
&lt;h4 id=&quot;select_a_wizard&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Select a Wizard&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-05.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Select the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Android&lt;/strong&gt;&amp;nbsp;folder, then choose&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Android Application Project&lt;/strong&gt;&amp;nbsp;and click&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Next&lt;/strong&gt;.&lt;/div&gt;
&lt;h4 id=&quot;create_your_project&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Create your project&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-00.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Enter &quot;BannerExample&quot; as the app and project names, and whatever package name you normally use. Next, give the project a minimum required SDK version of 9. That&#39;s the minimum version supported by the Google Mobile Ads SDK.&lt;/div&gt;
&lt;h4 id=&quot;configure_your_new_project&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Configure your new project&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-01.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
We&#39;re keeping it simple here, so uncheck the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Create custom launcher icon&lt;/strong&gt;&amp;nbsp;checkbox. Everything else can stay as it is.&lt;/div&gt;
&lt;h4 id=&quot;create_an_activity&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Create an activity&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-02.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
The defaults for this screen are just fine. The&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Create Activity&lt;/strong&gt;&amp;nbsp;checkbox should be checked, and the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Blank Activity&lt;/strong&gt;choice selected in the list.&lt;/div&gt;
&lt;h4 id=&quot;name_your_activity&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Name your activity&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-03.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Here again, the default options are what you need. Just click&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Finish&lt;/strong&gt;&amp;nbsp;and Eclipse will create your new project&#39;s source code.&lt;/div&gt;
&lt;h4 id=&quot;compile_your_new_project&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Compile your new project&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Once Eclipse is finished, try compiling and running your new app. You should see a &quot;Hello world!&quot; message on an otherwise empty gray screen. Don&#39;t worry, we&#39;ll add some more content in the next steps.&lt;/div&gt;
&lt;h2 id=&quot;download_the_google_play_services_sdk&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Download the Google Play services SDK&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
The Google Play services SDK contains classes and resources which your app can use to request and display ads. Make sure that you have the latest version by opening up your&amp;nbsp;&lt;a href=&quot;https://developer.android.com/tools/help/sdk-manager.html&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;SDK Manager&lt;/a&gt;. You can do this by selecting&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Window &amp;gt; Android SDK Manager&lt;/strong&gt;.&lt;/div&gt;
&lt;h4 id=&quot;the_sdk_manager&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
The SDK Manager&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-04.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
In the Android SDK Manager window, select&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;Google Play services&lt;/code&gt;&amp;nbsp;under the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;Extras&lt;/code&gt;&amp;nbsp;folder, then press&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Install Packages&lt;/strong&gt;&amp;nbsp;and accept the licenses to download. If the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Install Packages&lt;/strong&gt;&amp;nbsp;button is disabled, don&#39;t worry. That just means you already have the latest version, so there&#39;s nothing else you need to do in the SDK Manager.&lt;/div&gt;
&lt;h2 id=&quot;include_the_google_play_services_library&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Include the Google Play services library&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Now that the Google Play services SDK is downloaded, you can reference it in your project. Select&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;File &amp;gt; New &amp;gt; Project...&lt;/strong&gt;&amp;nbsp;from the menu.&lt;/div&gt;
&lt;h4 id=&quot;create_a_project_from_existing_code&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Create a project from existing code&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-05.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Select the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Android&lt;/strong&gt;&amp;nbsp;folder, then the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Android Project from Existing Code&lt;/strong&gt;&amp;nbsp;choice within it.&lt;/div&gt;
&lt;h4 id=&quot;import_project&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Import project&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-06.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Now you just need to tell Eclipse where it can find the library. Click the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Browse&lt;/strong&gt;&amp;nbsp;button and navigate to&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;&amp;lt;android-sdk&amp;gt;/extras/google/google_play_services/libproject/google-play-services_lib/&lt;/code&gt;, and click the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;OK&lt;/strong&gt;&amp;nbsp;button. When the browse dialog closes, you should see a single item in the&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Projects&lt;/strong&gt;&amp;nbsp;list. Make sure the checkbox next to it is checked, then click&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Finish&lt;/strong&gt;&amp;nbsp;to create a new project with the imported code.&lt;/div&gt;
&lt;h2 id=&quot;reference_the_imported_project&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Reference the imported project&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
With the new project created, you can reference it in your app&#39;s code. Right-click&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;BannerExample&lt;/strong&gt;&amp;nbsp;in the Package Explorer and select&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Properties&lt;/strong&gt;.&lt;/div&gt;
&lt;h4 id=&quot;properties_for_bannerexample&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Properties for BannerExample&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-07.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Select the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Android&lt;/strong&gt;&amp;nbsp;choice in the list of property sections on the left, then click the&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;Add...&lt;/strong&gt;&amp;nbsp;button.&lt;/div&gt;
&lt;h4 id=&quot;project_selection&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
Project selection&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot interfaceshot-eclipse&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-08.png&quot; style=&quot;border: 1px solid rgb(187, 187, 187); box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
You&#39;ll see&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;google-play-services_lib&lt;/code&gt;&amp;nbsp;in the list view. Choose it, then click&amp;nbsp;&lt;strong style=&quot;box-sizing: inherit;&quot;&gt;OK&lt;/strong&gt;&amp;nbsp;to close the selection dialog, and again to close the properties dialog. Your app now contains a reference to the Google Play services library project, which means it can use the classes and resources contained in the Google Play services SDK.&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Try building and running your app again to make sure everything is correctly in place. You won&#39;t see any changes, but including Google Play Services is the first step toward getting ads into your app.&lt;/div&gt;
&lt;h2 id=&quot;modify_the_manifest_file&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Modify the manifest file&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Now that you have a working app that includes Google Play Services, it&#39;s time to modify the app manifest file to include the permissions, version number, and activity definition that the Mobile Ads SDK requires. Open the Android manifest for the BannerExample project,&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AndroidManifest.xml&lt;/code&gt;, for editing. It will be under the&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;BannerExample/src/&lt;/code&gt;&amp;nbsp;folder, though the exact path depends on the package name you chose when setting up the project.&lt;/div&gt;
&lt;h4 id=&quot;androidmanifestxml&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
AndroidManifest.xml&lt;/h4&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-size: 14px; font-stretch: normal; line-height: 20px; margin-bottom: 16px; margin-top: 16px; overflow-x: auto; padding: 8px; position: relative;&quot;&gt;&lt;div aria-label=&quot;Click to copy&quot; class=&quot;devsite-click-to-copy-button gc-analytics-event&quot; data-category=&quot;Site-Wide Custom Events&quot; data-label=&quot;Click To Copy&quot; data-title=&quot;Click to copy&quot; data-tooltip-align=&quot;b,c&quot; data-tooltip=&quot;Click to copy&quot; style=&quot;background: rgb(189, 189, 189); box-sizing: inherit; content: url(https://developers.google.com/_static/images/ic_content_copy_white_24dp.svg); cursor: pointer; margin: -8px 0px 0px; opacity: 0; padding: 3px; position: absolute; right: 0px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;xml version&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; encoding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;manifest&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;package&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;com.google.android.gms.example.bannerexample&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;uses-sdk&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:minSdkVersion&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;9&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:targetSdkVersion&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;21&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: inherit; color: #d81b60;&quot;&gt;&amp;lt;!-- Include required permissions for Google Mobile Ads to run--&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;uses-permission&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;android.permission.INTERNET&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;uses-permission&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;android.permission.ACCESS_NETWORK_STATE&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;application&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:allowBackup&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:icon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:label&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:theme&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@style/AppTheme&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: inherit; color: #d81b60;&quot;&gt;&amp;lt;!--This meta-data tag is required to use Google Play Services.--&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;meta-data&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;com.google.android.gms.version&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@integer/google_play_services_version&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;activity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:label&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@string/app_name&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;intent-filter&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;action&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;android.intent.action.MAIN&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;category&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;android.intent.category.LAUNCHER&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/intent-filter&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/activity&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: inherit; color: #d81b60;&quot;&gt;&amp;lt;!--Include the AdActivity configChanges and theme. --&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;activity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;com.google.android.gms.ads.AdActivity&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:configChanges&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:theme&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@android:style/Theme.Translucent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/application&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
There are three changes you need to make:&lt;/div&gt;
&lt;ol style=&quot;box-sizing: inherit; list-style-position: outside; margin: 0px; padding-left: 40px;&quot;&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
Add two&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;&amp;lt;uses-permission&amp;gt;&lt;/code&gt;&amp;nbsp;tags for&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;INTERNET&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;ACCESS_NETWORK_STATE&lt;/code&gt;. The tag for&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;INTERNET&lt;/code&gt;&amp;nbsp;is required and used to access the Internet to make ad requests.&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;ACCESS_NETWORK_STATE&lt;/code&gt;&amp;nbsp;is optional, and used to check if an internet connection is available prior to making an ad request.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
Add a&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;&amp;lt;meta-data&amp;gt;&lt;/code&gt;&amp;nbsp;tag that references the Google Play Services version. This lets Android know which version of the service your app expects to use.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
Add an&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;&amp;lt;activity&amp;gt;&lt;/code&gt;&amp;nbsp;element with&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;configChanges&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;theme&lt;/code&gt;&amp;nbsp;attributes. This activity is used by the SDK when banners are clicked or interstitials are presented, and like any other activity must be declared in the manifest before being presented.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Go ahead and rebuild the project to make sure everything has been done correctly. You should still see the same &quot;Hello world!&quot; message for now. By configuring the App Manifest correctly, though, you&#39;ve given your app the ability to use Mobile Ads.&lt;/div&gt;
&lt;h2 id=&quot;give_your_app_an_ad_unit_id&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Give your app an Ad Unit ID&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
An Ad Unit ID is a unique identifier given to the places in your app where ads are displayed. If you had an app with two activities, for example, each displaying a banner, you&#39;d have two ad units, each with its own ID. AdMob ad unit IDs have the form&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;ca-app-pub-XXXXXXXXXXXXXXXX/NNNNNNNNNN&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
In order for your new app to display an ad, it needs to include an Ad Unit ID. Open your app&#39;s string resource file, which is found at&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;BannerExample/res/values/strings.xml&lt;/code&gt;.&lt;/div&gt;
&lt;h4 id=&quot;stringsxml&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
strings.xml&lt;/h4&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-size: 14px; font-stretch: normal; line-height: 20px; margin-bottom: 16px; margin-top: 16px; overflow-x: auto; padding: 8px; position: relative;&quot;&gt;&lt;div aria-label=&quot;Click to copy&quot; class=&quot;devsite-click-to-copy-button gc-analytics-event&quot; data-category=&quot;Site-Wide Custom Events&quot; data-label=&quot;Click To Copy&quot; data-title=&quot;Click to copy&quot; data-tooltip-align=&quot;b,c&quot; data-tooltip=&quot;Click to copy&quot; style=&quot;background: rgb(189, 189, 189); box-sizing: inherit; content: url(https://developers.google.com/_static/images/ic_content_copy_white_24dp.svg); cursor: pointer; margin: -8px 0px 0px; opacity: 0; padding: 3px; position: absolute; right: 0px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;xml version&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; encoding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;resources&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;string&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;app_name&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;My Application&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;string&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;hello_world&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;Hello world!&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;string&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;action_settings&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;Settings&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;string&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;banner_ad_unit_id&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;ca-app-pub-3940256099942544/6300978111&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/resources&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Add a new&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;&amp;lt;string&amp;gt;&lt;/code&gt;&amp;nbsp;tag as shown. Note that the Ad Unit ID provided above is just for testing. It will allow you to retrieve a sample banner ad and make sure your implementation is correct.&lt;/div&gt;
&lt;aside class=&quot;special&quot; style=&quot;background: rgb(3, 155, 229); box-sizing: inherit; color: white; font-size: 14px; margin: 16px 0px; padding: 24px 24px 24px 72px;&quot;&gt;You should always use test ads when developing and testing your app. Using live ads during development is against AdMob policy; if you test on live ads, your AdMob account may be suspended.&lt;/aside&gt;&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
See the&amp;nbsp;&lt;a href=&quot;https://developer.android.com/reference/com/google/android/gms/ads/AdRequest.Builder.html#addTestDevice(java.lang.String)&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;addTestDevice&lt;/a&gt;&amp;nbsp;method documentation for information on how to get test ads with your own Ad Unit IDs.&lt;/div&gt;
&lt;aside class=&quot;special&quot; style=&quot;background: rgb(3, 155, 229); box-sizing: inherit; color: white; font-size: 14px; margin: 16px 0px; padding: 24px 24px 24px 72px;&quot;&gt;While it&#39;s not a requirement, storing your Ad Unit ID values in a resource file is a good practice. As your app grows and your ad publishing needs mature, you will occasionally find that you want to change the ID values. If you make sure they&#39;re always in a resource file, you&#39;ll never have to search through your code looking for them.&lt;/aside&gt;&lt;h2 id=&quot;place_an_adview_in_your_main_activity_layout&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Place an AdView in your main activity layout&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
There are only two steps remaining before your app is ready to show an ad. First, you&#39;ll need to modify your main activity&#39;s layout to include an&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;. Open&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;BannerExample/res/layout/activity_main.xml&lt;/code&gt;&amp;nbsp;in the editor.&lt;/div&gt;
&lt;h4 id=&quot;activity_mainxml&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
activity_main.xml&lt;/h4&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-size: 14px; font-stretch: normal; line-height: 20px; margin-bottom: 16px; margin-top: 16px; overflow-x: auto; padding: 8px; position: relative;&quot;&gt;&lt;div aria-label=&quot;Click to copy&quot; class=&quot;devsite-click-to-copy-button gc-analytics-event&quot; data-category=&quot;Site-Wide Custom Events&quot; data-label=&quot;Click To Copy&quot; data-title=&quot;Click to copy&quot; data-tooltip-align=&quot;b,c&quot; data-tooltip=&quot;Click to copy&quot; style=&quot;background: rgb(189, 189, 189); box-sizing: inherit; content: url(https://developers.google.com/_static/images/ic_content_copy_white_24dp.svg); cursor: pointer; margin: -8px 0px 0px; opacity: 0; padding: 3px; position: absolute; right: 0px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;RelativeLayout&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;xmlns:tools&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;http://schemas.android.com/tools&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;xmlns:ads&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;http://schemas.android.com/apk/res-auto&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:paddingLeft&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@dimen/activity_horizontal_margin&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:paddingRight&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@dimen/activity_horizontal_margin&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:paddingTop&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@dimen/activity_vertical_margin&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:paddingBottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@dimen/activity_vertical_margin&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;tools:context&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;.MainActivity&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;TextView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@string/hello_world&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;com.google.android.gms.ads.AdView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@+id/adView&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_centerHorizontal&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;android:layout_alignParentBottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;ads:adSize&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;BANNER&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;ads:adUnitId&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;box-sizing: inherit; color: #689f38;&quot;&gt;&quot;@string/banner_ad_unit_id&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/com.google.android.gms.ads.AdView&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;&amp;lt;/RelativeLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Add two things to the XML:&lt;/div&gt;
&lt;ol style=&quot;box-sizing: inherit; list-style-position: outside; margin: 0px; padding-left: 40px;&quot;&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
An additional namespace used for ads,&amp;nbsp;&lt;a href=&quot;http://schemas.android.com/apk/res-auto&quot; style=&quot;box-sizing: inherit; color: #03a9f4; outline: 0px; text-decoration: none;&quot;&gt;http://schemas.android.com/apk/res-auto&lt;/a&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
A new element for your AdView. You&#39;ll be asked to provide&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;layout_width&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;layout_height&lt;/code&gt;. You can set these both to&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;wrap_content&lt;/code&gt;. In the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;&amp;nbsp;tag, set the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;adSize&lt;/code&gt;&amp;nbsp;to&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;BANNER&lt;/code&gt;&amp;nbsp;and the&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;adUnitId&lt;/code&gt;&amp;nbsp;to&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;@string/banner_ad_unit_id&lt;/code&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;aside class=&quot;special&quot; style=&quot;background: rgb(3, 155, 229); box-sizing: inherit; color: white; font-size: 14px; margin: 16px 0px; padding: 24px 24px 24px 72px;&quot;&gt;If you look at the last parameter in the&amp;nbsp;&lt;code style=&quot;background: 0px 50%; box-sizing: inherit; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; font-weight: 700; line-height: 1; margin-top: 0px; padding: 0px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;&amp;nbsp;tag, you&#39;ll see that it&#39;s called&amp;nbsp;&lt;code style=&quot;background: 0px 50%; box-sizing: inherit; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; font-weight: 700; line-height: 1; margin-bottom: 0px; padding: 0px; word-break: break-word;&quot;&gt;adUnitId&lt;/code&gt;. This is the Ad Unit ID that the AdView will use when requesting ads. In this case, we&#39;ve given it a reference to the string resource you added in the last step, so the AdView will use that value.&lt;/aside&gt;&lt;h2 id=&quot;load_the_ad_in_the_mainactivity_class&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Load the ad in the MainActivity class&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
The last change needed is for you to add to your app&#39;s main activity class some Java code that will load an ad into the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Open your&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;MainActivity.java&lt;/code&gt;&amp;nbsp;file. It will be in the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;BannerExample/src/&lt;/code&gt;&amp;nbsp;folder, though again the exact subdirectory path will vary based on the domain you used when creating your project above. Once it&#39;s open in the editor, look for the onCreate method in the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;MainActivity&lt;/code&gt;&amp;nbsp;class:&lt;/div&gt;
&lt;h4 id=&quot;mainactivityjava_excerpt&quot; style=&quot;box-sizing: inherit; font-size: 18px; font-stretch: normal; font-weight: 500; line-height: 32px; margin: 32px 0px 16px; overflow: hidden; padding: 0px; text-overflow: ellipsis;&quot;&gt;
MainActivity.java (excerpt)&lt;/h4&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-size: 14px; font-stretch: normal; line-height: 20px; margin-bottom: 16px; margin-top: 16px; overflow-x: auto; padding: 8px; position: relative;&quot;&gt;&lt;div aria-label=&quot;Click to copy&quot; class=&quot;devsite-click-to-copy-button gc-analytics-event&quot; data-category=&quot;Site-Wide Custom Events&quot; data-label=&quot;Click To Copy&quot; data-title=&quot;Click to copy&quot; data-tooltip-align=&quot;b,c&quot; data-tooltip=&quot;Click to copy&quot; style=&quot;background: rgb(189, 189, 189); box-sizing: inherit; content: url(https://developers.google.com/_static/images/ic_content_copy_white_24dp.svg); cursor: pointer; margin: -8px 0px 0px; opacity: 0; padding: 3px; position: absolute; right: 0px; width: 24px;&quot;&gt;
&lt;/div&gt;
&lt;code style=&quot;background: 0px 50%; box-sizing: inherit; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 0px; word-break: normal;&quot;&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;package&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;...&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;ads&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;AdRequest&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; com&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;google&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;gms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;ads&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;AdView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;MainActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;ActionBarActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;activity_main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;newcode&quot; style=&quot;box-sizing: inherit; font-weight: bold;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;AdView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; mAdView &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;AdView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; findViewById&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;adView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;AdRequest&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; adRequest &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: inherit; color: #0097a7;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;AdRequest&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: inherit; color: #9c27b0;&quot;&gt;Builder&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mAdView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;loadAd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;adRequest&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;oldcode&quot; style=&quot;box-sizing: inherit; opacity: 0.4;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: inherit;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Make these two changes:&lt;/div&gt;
&lt;ol style=&quot;box-sizing: inherit; list-style-position: outside; margin: 0px; padding-left: 40px;&quot;&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
Import the&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdRequest&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;&amp;nbsp;classes&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: inherit; margin: 8px 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;box-sizing: inherit; padding: 0px;&quot;&gt;
Add the code that will find your&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;&amp;nbsp;in the layout, create an&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdRequest&lt;/code&gt;, and then load an ad into the&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;&amp;nbsp;with it.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Once that&#39;s completed, you&#39;re finished. You now have a fully functional&amp;nbsp;&lt;code style=&quot;background: rgb(247, 247, 247); box-sizing: inherit; color: #455a64; font-family: &#39;Roboto Mono&#39;, monospace; font-stretch: normal; line-height: 1; padding: 1px 4px; word-break: break-word;&quot;&gt;AdView&lt;/code&gt;&amp;nbsp;in your app&#39;s main activity.&lt;/div&gt;
&lt;h2 id=&quot;enjoy_a_freshly_loaded_ad&quot; style=&quot;border-bottom-color: rgb(235, 235, 235); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: inherit; font-size: 24px; font-stretch: normal; font-weight: 400; letter-spacing: -0.01em; line-height: 32px; margin: 40px 0px 20px; overflow: hidden; padding: 0px 0px 3px; text-overflow: ellipsis;&quot;&gt;
Enjoy a freshly loaded ad&lt;/h2&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Your app is now ready to display an ad using the Google Mobile Ads SDK. Run it again, and you should see a test banner displayed at the bottom of the device screen:&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
&lt;img class=&quot;interfaceshot&quot; src=&quot;https://developers.google.com/admob/images/eclipse-quickstart-09.png&quot; style=&quot;border: 0px; box-sizing: inherit; margin: 0px; max-width: 700px; padding: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;box-sizing: inherit; margin-bottom: 16px; margin-top: 16px; padding: 0px;&quot;&gt;
Congratulations! You&#39;ve successfully integrated banner ads into an app with Eclipse.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/6079304383905511756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/11/admob-for-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6079304383905511756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6079304383905511756'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/11/admob-for-android.html' title='AdMob for Android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-6541853972311757566</id><published>2015-10-17T00:25:00.001-07:00</published><updated>2015-10-17T00:25:47.755-07:00</updated><title type='text'>How to find Android default screen orientation.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
as i tried for the requirement of my personal project for getting&amp;nbsp;default screen orientation.&lt;br /&gt;
&lt;br /&gt;
i got the very simple solution taking int value&lt;br /&gt;
&lt;br /&gt;
int orient=this.getResources().getConfiguration().orientation;&lt;br /&gt;
&lt;br /&gt;
it will give the result either 1 or 2&lt;br /&gt;
&lt;br /&gt;
1 is portrait and 2 is landscape&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/6541853972311757566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/10/how-to-find-android-default-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6541853972311757566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/6541853972311757566'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/10/how-to-find-android-default-screen.html' title='How to find Android default screen orientation.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-5872875693776620839</id><published>2015-10-02T23:19:00.001-07:00</published><updated>2015-10-02T23:19:53.970-07:00</updated><title type='text'>Auto logout after 15 minutes due to inactivity in android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
create a service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ublic class LogoutService extends Service{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static CountDownTimer timer;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private final String TAG=&quot;Service&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onCreate() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super.onCreate();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; timer = new CountDownTimer(1 *60 * 1000, 1000) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onTick(long millisUntilFinished) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Some code&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Log.v(TAG, &quot;Service Started&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onFinish() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Log.v(TAG, &quot;Call Logout by Service&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Code for Logout&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stopSelf();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public IBinder onBind(Intent intent) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
then add the code for all activity&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; @Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; protected void onResume() {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; // TODO Auto-generated method stub&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; super.onResume();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; try {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; LogoutService.timer.start();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;} catch (Exception e) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;e.printStackTrace();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; @Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; protected void onStop() {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; // TODO Auto-generated method stub&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; super.onStop();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; LogoutService.timer.cancel();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; } &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
here after certain minutes the first page will be displayed automatically&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/5872875693776620839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/10/auto-logout-after-15-minutes-due-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/5872875693776620839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/5872875693776620839'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/10/auto-logout-after-15-minutes-due-to.html' title='Auto logout after 15 minutes due to inactivity in android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-9110080206637807300</id><published>2015-08-28T04:33:00.001-07:00</published><updated>2015-08-28T04:33:28.845-07:00</updated><title type='text'>Asynchronous HTTP Requests in Android Using Volley</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
olley is the new Swiss Army Knife of Android Developers, it provides some nice utilities which makes the networking for Android apps easier and faster. The good thing about Volley is that it abstracts away the low level details of what HTTP client library is being used under the hood and helps you focus on writing nice and clean RESTful HTTP requests. Additionally all requests in Volley are executed asynchronously on a different thread without blocking your “main thread”.&lt;/div&gt;
&lt;h2 style=&quot;background: url(http://arnab.ch/images/dots.png?1374916853) 0% 0% repeat-x rgb(248, 248, 248); border-bottom-style: none; color: #574c4c; font-family: &#39;Source Sans Pro&#39;, sans-serif; margin: 10px 0px 1.5em; padding: 0.8em 0px 0px; position: relative;&quot;&gt;
What are the features that Volley provides?&lt;/h2&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Important features of the Volley library:&lt;/div&gt;
&lt;ul style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em 20px; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;A high level API to make asynchronous RESTful HTTP requests&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;An elegant and robust Request queue&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;An extensible architecture which allows developers to implement custom request and response handling mechanism&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Ability to use external HTTP client library&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Robust request caching policy&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Custom views to load and cache images from Network (&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;NetworkImageView&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;ImageLoader&lt;/code&gt;&amp;nbsp;etc)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;background: url(http://arnab.ch/images/dots.png?1374916853) 0% 0% repeat-x rgb(248, 248, 248); border-bottom-style: none; color: #574c4c; font-family: &#39;Source Sans Pro&#39;, sans-serif; margin: 10px 0px 1.5em; padding: 0.8em 0px 0px; position: relative;&quot;&gt;
Why use asynchronous HTTP requests?&lt;/h2&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
In Android it is always a good practice to make HTTP requests asynchronously, in fact from HoneyComb onwards it is no longer just a “good practice”, you must make HTTP requests asynchronously off the main thread or else you’ll get this nasty exception&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;android.os.NetworkOnMainThreadException&lt;/code&gt;. Blocking the main thread has some serious consequences, it hampers UI rendering, harmful to smooth user experience and above all it can cause dreaded ANR (Application Not Responding). To avoid all these pitfalls you as a developer should always ensure that your HTTP requests are on a different thread.&lt;/div&gt;
&lt;h2 style=&quot;background: url(http://arnab.ch/images/dots.png?1374916853) 0% 0% repeat-x rgb(248, 248, 248); border-bottom-style: none; color: #574c4c; font-family: &#39;Source Sans Pro&#39;, sans-serif; margin: 10px 0px 1.5em; padding: 0.8em 0px 0px; position: relative;&quot;&gt;
How to use Volley&lt;/h2&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
We are going to cover the following items in this blog post, by the end of it you should be able to have a clear understanding of Volley and how to use it in your application.&lt;/div&gt;
&lt;ul style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em 20px; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Installing and using Volley as a library project&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Using Request Queue&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Making asynchronous JSON and String HTTP requests&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Cancelling requests&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Retrying failed requests, customizing request Timeout&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Setting Request Headers (HTTP headers)&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Using cookies&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Error Handling&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Installing and using Volley as a library project&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Volley is part of AOSP and right now it is not being distributed as a JAR, the easiest way to include Volley to your project is to clone the Volley repository and set it as a library project.&lt;/div&gt;
&lt;h4 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Using as a library project&lt;/h4&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Git clone the repository using the following command and then import it as Android library project:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;sh&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;nv&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;$ &lt;/span&gt;git clone https://android.googlesource.com/platform/frameworks/volley
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h4 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Using as a JAR&lt;/h4&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Clone the repository as shown above and then run the following commands to export it as JAR and after that add the JAR file to your project’s&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;/libs&lt;/code&gt;&amp;nbsp;folder:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;bash&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;# in Volley project root (ensure the `android` executable is in your path)&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;nv&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;$ &lt;/span&gt;android update project -p .
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;# the following command will create a JAR file and put it in ./bin&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;nv&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;$ &lt;/span&gt;ant jar
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Using Request Queue&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
All requests in Volley are placed in a queue first and then processed, here is how you will be creating a request queue:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;RequestQueue&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;RequestQueue&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Volley&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;newRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// &#39;this&#39; is Context&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Ideally you should have one centralized place for your Queue, and the best place to initialize queue is in your&amp;nbsp;&lt;a href=&quot;http://developer.android.com/reference/android/app/Application.html&quot; style=&quot;color: #1abc9c; margin: 0px; outline-width: 0px; padding: 0px; text-decoration: none;&quot;&gt;Application&lt;/a&gt;&amp;nbsp;class. Here is how this can be done:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;ApplicationController.java&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;21&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;22&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;23&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;25&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;26&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;27&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;28&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;29&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;31&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;32&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;33&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;34&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;35&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;36&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;37&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;38&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;39&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;40&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;41&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;42&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;43&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;44&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;45&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;46&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;47&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;48&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;49&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;50&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;51&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;52&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;53&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;54&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;55&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;56&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;58&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;59&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;60&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;61&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;62&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;63&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;64&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;66&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;67&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;68&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;69&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;70&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;71&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;72&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;73&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;74&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;75&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;76&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;77&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;78&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;79&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;80&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;81&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;82&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;83&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;84&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;85&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;86&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;color: rgb(211, 54, 130) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Application&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * Log or request TAG&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;TAG&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;VolleyPatterns&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * Global request queue for Volley&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;RequestQueue&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * A singleton instance of the application class for easy access in other places&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;sInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// initialize the singleton&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;sInstance&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @return ApplicationController singleton instance&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;synchronized&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;sInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @return The Volley Request queue, the queue will be created if it is null&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;RequestQueue&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;getRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// lazy initialize the request queue, the queue instance will be&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// created when it is accessed for the first time&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot; style=&quot;color: rgb(133, 153, 0) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Volley&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;newRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getApplicationContext&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * Adds the specified request to the global queue, if tag is specified&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * then it is used else Default TAG is used.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param req&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param tag&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Request&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// set the default tag if tag is empty&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;setTag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;TextUtils&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;TAG&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Adding request to queue: %s&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getUrl&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * Adds the specified request to the global queue using the Default TAG.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param req&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param tag&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Request&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// set the default tag if tag is empty&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;setTag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;TAG&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * Cancels all pending requests by the specified TAG, it is important&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * to specify a TAG so that the pending/ongoing requests can be cancelled.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param tag&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;cancelPendingRequests&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot; style=&quot;color: rgb(133, 153, 0) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;cancelAll&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Making asynchronous HTTP requests&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Volley provides the following utility classes which you can use to make asynchronous HTTP requests:&lt;/div&gt;
&lt;ul style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em 20px; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://goo.gl/CRMvRj&quot; style=&quot;color: #1abc9c; margin: 0px; outline-width: 0px; padding: 0px; text-decoration: none;&quot;&gt;JsonObjectRequest&lt;/a&gt;&amp;nbsp;— To send and receive JSON Object from the Server&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://goo.gl/F02Ew3&quot; style=&quot;color: #1abc9c; margin: 0px; outline-width: 0px; padding: 0px; text-decoration: none;&quot;&gt;JsonArrayRequest&lt;/a&gt;&amp;nbsp;— To receive JSON Array from the Server&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://goo.gl/c5DB8p&quot; style=&quot;color: #1abc9c; margin: 0px; outline-width: 0px; padding: 0px; text-decoration: none;&quot;&gt;StringRequest&lt;/a&gt;&amp;nbsp;— To retrieve response body as String (ideally if you intend to parse the response by yourself)&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Note:&lt;/em&gt;&amp;nbsp;To send parameters in request body you need to override either&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;getParams()&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;getBody()&lt;/code&gt;&amp;nbsp;method of the request classes (as required) described below.&lt;/div&gt;
&lt;h4 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
JsonObjectRequest&lt;/h4&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
This class can be used to send and receive JSON object. An overloaded constructor of this class allows to set appropriate request method (DELETE, GET, POST and PUT). This is the class which you should be using frequently if you are working with a RESTful backend. The following examples show how to make GET and POST requests.&lt;/div&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Using HTTP GET method:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;JsonObjectRequest&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;21&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;/volley/resource/12&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// pass second argument as &quot;null&quot; for GET requests&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonObjectRequest&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonObjectRequest&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot; style=&quot;color: rgb(133, 153, 0) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Listener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                   &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Response:%n %s&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONException&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                   &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ErrorListener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onErrorResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Error: &quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// add the request object to the queue to be executed&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Using HTTP POST method:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;JsonObjectRequest&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;21&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;22&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;23&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;24&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;/volley/resource/12&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// Post params to be sent to the server&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;params&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;token&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;AbCdEfGh123456&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonObjectRequest&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonObjectRequest&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Listener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                   &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Response:%n %s&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONException&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                   &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ErrorListener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onErrorResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Error: &quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// add the request object to the queue to be executed&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h4 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
JsonArrayRequest&lt;/h4&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
This class can be used to retrieve&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;JSON array&lt;/strong&gt;&amp;nbsp;but not&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;JSON object&lt;/strong&gt;&amp;nbsp;and only HTTP GET is supported as of now. As it supports only GET, so if you are to specify some querystring parameters then append those in the URL itself. The constructor does not accept request parameters.&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;JsonArrayRequest&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;/volley/resource/all?count=20&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonArrayRequest&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonArrayRequest&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Listener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONArray&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONArray&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Response:%n %s&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONException&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ErrorListener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onErrorResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Error: &quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// add the request object to the queue to be executed&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h4 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
StringRequest&lt;/h4&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
This class can be used to retrieve the response from server as String, ideally you should use this class when you intend to parse the response by yourself, e.g. if it is XML. It also provides overloaded constructors to further customize your request.&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;StringRequest&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;/volley/resource/recent.xml&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;StringRequest&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;StringRequest&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Listener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Response:%n %s&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ErrorListener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onErrorResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyLog&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Error: &quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// add the request object to the queue to be executed&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Setting a priority to the request is possible, this may be desirable in some cases where you want to move certain requests higher up in the order. The requests are processed from higher priorities to lower priorities, in FIFO order. To set a priority you need to override the&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;getPriority()&lt;/code&gt;&amp;nbsp;method of the request class. The current available priorities are –&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;Priority.LOW&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;Priority.NORMAL&lt;/code&gt;,&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;Priority.HIGH&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;Priority.IMMEDIATE&lt;/code&gt;.&lt;/div&gt;
&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Cancelling requests&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Volley provides powerful APIs to cancel pending or ongoing requests, one reason when you need to do this is if user rotates his device while a request is ongoing you need to cancel that because the Activity is going be restarted. The easiest way to cancel a request is to call the&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;cancelAll(tag)&lt;/code&gt;&amp;nbsp;method of the request queue, this will only work if you have set a&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;tag on the request object&lt;/strong&gt;&amp;nbsp;before adding it to the queue. The ability to tag requests allows you to cancel all pending requests for that tag in one method call.&lt;/div&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Adding a request to the queue using a tag:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;setTag&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;My Tag&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
As per the ApplicationController class shown above, this is how you’ll add the request to the queue:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addToRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;My Tag&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Cancelling all requests with the specified tag:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;cancelAll&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;My Tag&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
As per the ApplicationController class shown above, this is how you’ll cancel the requests:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ApplicationController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getInstance&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;cancelPendingRequests&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;My Tag&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Retrying failed requests and customizing request Timeout&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
There is no direct way to specify request timeout value in Volley, but there is a workaround, you need to set a RetryPolicy on the request object. The&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;DefaultRetryPolicy&lt;/code&gt;&amp;nbsp;class takes an argument called&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;initialTimeout&lt;/em&gt;, this can be used to specify a request timeout, make sure the maximum retry count is 1 so that volley does not retry the request after the timeout has been exceeded.&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;Setting Request Timeout&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 830px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;setRetryPolicy&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;DefaultRetryPolicy&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mf&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;1.0f&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
If you want to retry failed requests (due to timeout) you can specify that too using the code above, just increase the retry count. Note the last argument, it allows you to specify a backoff multiplier which can be used to implement “exponential backoff” that some RESTful services recommend.&lt;/div&gt;
&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Setting Request Headers (HTTP headers)&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Sometimes it is necessary to add extra headers to the HTTP requests, one common case is to add an “Authorization” header for HTTP Basic Auth. Volley Request class provides a method called&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;getHeaders()&lt;/code&gt;&amp;nbsp;which you need to override to add your custom headers if necessary.&lt;/div&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Adding custom headers:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;21&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonObjectRequest&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;req&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JsonObjectRequest&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Listener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;JSONObject&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                   &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// handle response&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ErrorListener&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;onErrorResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                   &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// handle error                        &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;               &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;nd&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getHeaders&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;AuthFailureError&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;headers&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;CUSTOM_HEADER&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Yahoo&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;ANOTHER_CUSTOM_HEADER&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;Google&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;           &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;       &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;   &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Using cookies&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
There is no direct API through which you can set cookies in Volley. This makes sense because the core philosophy of Volley is to provide clean APIs to write RESTful HTTP requests, these days most of the RESTful API providers prefer authentication tokens instead of cookies. Using cookies in Volley is a bit more involed process and not very straight forward.&lt;/div&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
Here is a modified version of the&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;getRequestQueue()&lt;/code&gt;&amp;nbsp;method of our ApplicationController class shown above, also contains the rough code required to set a cookie:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;21&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;22&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;23&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;25&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;26&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;27&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;28&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;29&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;30&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// http client instance&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;DefaultHttpClient&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mHttpClient&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;RequestQueue&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;getRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// lazy initialize the request queue, the queue instance will be&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// created when it is accessed for the first time&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot; style=&quot;color: rgb(133, 153, 0) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// Create an instance of the Http client. &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// We need this in order to access the cookie store&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mHttpClient&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;DefaultHttpClient&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// create the request queue&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Volley&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;newRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;HttpClientStack&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mHttpClient&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt; * Method to set a cookie&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt; */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;setCookie&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;CookieStore&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;cs&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mHttpClient&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getCookieStore&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// create a cookie&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;    &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;cs&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;addCookie&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;BasicClientCookie2&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;cookie&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;spooky&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// add the cookie before adding the request to the queue&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;setCookie&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// add the request to the queue&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;mRequestQueue&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;h3 style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 1.3em; margin: 10px 0px 1.5em; padding: 0px;&quot;&gt;
Error Handling&lt;/h3&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
As you have seen in the above code examples when you create a request object in Volley you need to specify an error listener, Volley invokes the&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;onErrorResponse&lt;/code&gt;&amp;nbsp;callback method of that listener passing an instance of the&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;VolleyError&lt;/code&gt;&amp;nbsp;object when there is an error while performing the request.&lt;/div&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
The following is the list of exceptions in Volley:&lt;/div&gt;
&lt;ul style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em 20px; padding: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;AuthFailureError&lt;/strong&gt;&amp;nbsp;— If you are trying to do Http Basic authentication then this error is most likely to come.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;NetworkError&lt;/strong&gt;&amp;nbsp;— Socket disconnection, server down, DNS issues might result in this error.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;NoConnectionError&lt;/strong&gt;&amp;nbsp;— Similar to NetworkError, but fires when device does not have internet connection, your error handling logic can club&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;NetworkError&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;NoConnectionError&lt;/code&gt;&amp;nbsp;together and treat them similarly.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;ParseError&lt;/strong&gt;&amp;nbsp;— While using&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;JsonObjectRequest&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px 3px; padding: 1px 3px;&quot;&gt;JsonArrayRequest&lt;/code&gt;&amp;nbsp;if the received JSON is malformed then this exception will be generated. If you get this error then it is a problem that should be fixed instead of being handled.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;ServerError&lt;/strong&gt;&amp;nbsp;— The server responded with an error, most likely with&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;4xx&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;5xx&lt;/em&gt;&amp;nbsp;HTTP status codes.&lt;/li&gt;
&lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;TimeoutError&lt;/strong&gt;&amp;nbsp;— Socket timeout, either server is too busy to handle the request or there is some network latency issue. By default Volley times out the request after&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;2.5 seconds&lt;/strong&gt;, use a RetryPolicy if you are consistently getting this error.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #f8f8f8; color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin-bottom: 1.5em; margin-top: 10px; padding: 0px;&quot;&gt;
You can use a simple helper like the following to display appropriate message when one of these exceptions occurs:&lt;/div&gt;
&lt;figure class=&quot;code&quot; style=&quot;background: rgb(221, 221, 221); border-radius: 5px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: &#39;Source Sans Pro&#39;, sans-serif; font-size: 16px; line-height: 24px; margin: 10px 0px 1.5em; padding: 5px 15px;&quot;&gt;&lt;figcaption style=&quot;font-size: 0.9em; margin: 0px; padding: 0px; position: relative;&quot;&gt;&lt;span style=&quot;background: -webkit-linear-gradient(top, rgb(204, 204, 204), rgb(221, 221, 221)); display: block; margin: -5px -15px 0px; padding: 5px 15px;&quot;&gt;VolleyErrorHelper.java&lt;/span&gt;&lt;/figcaption&gt;&lt;div class=&quot;highlight&quot; style=&quot;margin: 0px; overflow-x: auto; padding: 0px;&quot;&gt;
&lt;table style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-spacing: 0px; border: none; line-height: 1.2em; margin: 0px; padding: 0px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;pre class=&quot;line-numbers&quot; style=&quot;background: none; border-radius: 0px; border-right-color: rgb(204, 204, 204); border-right-width: 1px; border-style: none solid none none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; line-height: 1.9; overflow-x: auto; padding: 0px 15px 0px 0px; text-align: right;&quot;&gt;&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;21&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;22&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;23&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;25&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;26&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;27&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;28&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;29&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;31&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;32&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;33&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;34&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;35&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;36&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;37&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;38&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;39&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;40&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;41&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;42&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;43&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;44&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;45&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;46&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;47&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;48&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;49&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;50&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;51&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;52&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;53&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;54&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;55&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;56&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;58&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;59&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;60&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;61&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;62&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;63&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;64&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;66&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;67&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;68&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;69&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;70&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;71&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;72&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;73&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;74&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;75&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;76&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;77&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;78&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;79&lt;/span&gt;
&lt;span class=&quot;line-number&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;80&lt;/span&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;margin: 0px; padding: 0px 0px 0px 15px; width: 822px;&quot;&gt;&lt;pre style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; line-height: 1.5; overflow-x: auto; padding: 0px;&quot;&gt;&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot; style=&quot;color: rgb(211, 54, 130) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyErrorHelper&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;     &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * Returns appropriate message which is to be displayed to the user &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * against the specified error object.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param error&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @param context&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     * @return&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;     */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Context&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;TimeoutError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;          &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;generic_server_down&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;isServerProblem&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;          &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;handleServerError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;isNetworkProblem&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;          &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;no_internet&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;generic_error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * Determines whether the error is related to network&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @param error&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @return&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;isNetworkProblem&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;NetworkError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;NoConnectionError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * Determines whether the error is related to server&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @param error&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @return&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;isServerProblem&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;ServerError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;instanceof&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;AuthFailureError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;/**&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * Handles the server error, tries to determine whether to show a stock message or to &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * show a message retrieved from the server.&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * &lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @param err&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @param context&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  * @return&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;cm&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;  */&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: rgb(38, 139, 210) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;handleServerError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Context&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;VolleyError&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;NetworkResponse&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;networkResponse&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot; style=&quot;color: rgb(133, 153, 0) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;          &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;statusCode&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;404&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;422&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;mi&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;401&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                    &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// server might return error like this { &quot;error&quot;: &quot;Some error occured&quot; }&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                    &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// Use &quot;Gson&quot; to parse the result&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                    &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Gson&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;fromJson&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                            &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;TypeToken&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                            &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getType&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                    &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot; style=&quot;color: rgb(133, 153, 0) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;containsKey&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: rgb(42, 161, 152) !important; margin: 0px; padding: 0px;&quot;&gt;&quot;error&quot;&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                    &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                    &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                &lt;span class=&quot;c1&quot; style=&quot;color: rgb(88, 110, 117) !important; font-style: italic !important; margin: 0px; padding: 0px;&quot;&gt;// invalid request&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;generic_server_down&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;            &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;      &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        &lt;span class=&quot;k&quot; style=&quot;color: rgb(203, 75, 22) !important; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;getString&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot; style=&quot;color: rgb(38, 139, 210) !important; margin: 0px; padding: 0px;&quot;&gt;generic_error&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  &lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;code class=&quot;java&quot; style=&quot;background: none; border-radius: 0px; border: none; font-family: Menlo, Monaco, &#39;Andale Mono&#39;, &#39;lucida console&#39;, &#39;Courier New&#39;, monospace; font-size: 0.8em; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;line&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;o&quot; style=&quot;color: rgb(147, 161, 161) !important; font-weight: bold !important; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/figure&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/9110080206637807300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/08/asynchronous-http-requests-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/9110080206637807300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/9110080206637807300'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/08/asynchronous-http-requests-in-android.html' title='Asynchronous HTTP Requests in Android Using Volley'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-7708612556032678582</id><published>2015-08-16T23:15:00.002-07:00</published><updated>2015-08-16T23:15:54.583-07:00</updated><title type='text'>How to change the layout theme of an Android Application </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
What is Theme?&lt;/h3&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
In any mobile, we have display settings, and the option to set the entire mobile theme such as light blue colour theme, red colour theme or any other colour. This will make the entire mobile functionality with this theme setting.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
One needs to understand the style in Android so as to set the theme of an Android application.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
Style is an XML file that resides in &quot;project/res/values&quot; directory and usually comprises of settings of appearances. The basic structure of &quot;style.xml&quot; is as below:&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;resources&amp;gt;
    &amp;lt;style name=&quot;nameOfTheTheme&quot;&amp;gt;
        &amp;lt;item name=&quot;android:attributeSets&quot;&amp;gt;value&amp;lt;/item&amp;gt;
    &amp;lt;/style&amp;gt;
&amp;lt;/resources&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
We can notice here that that in the style tag, there is one attribute named &quot;name&quot; which has the value. This value determines the &quot;name of theme&quot;, for example, &quot;MyTheme&quot;.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
The next is an &quot;item&quot; tag that comprises of several attribute sets of views like &quot;android:textColor&quot;, &quot; android:textSize&quot; etc. We need to specify this attribute and then write the value corresponding to it. Here is an example of a style.xml file:&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;resources&amp;gt;
    &amp;lt;style name=&quot;MyTheme&quot;&amp;gt;
        &amp;lt;item name=&quot;android:textColor&quot;&amp;gt;#FF0000&amp;lt;/item&amp;gt;
    &amp;lt;/style&amp;gt;
&amp;lt;/resources&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
It can be observed clearly that the name of the style is &quot;My Theme&quot; and the item tag has the attribute &quot;Text Colour” that possesses the value &quot;#FF0000&quot; which is the colour &quot;Red&quot;.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
The following code needs to be written before the setting of a layout file in &quot;setContentView&quot;. This will set the theme while your activity is loading.&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;activity.setTheme(R.style.MyTheme);
setContentView(R.layout.main);&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
The application theme will be set before loading layout using the above code. Let us follow the below steps to create the application.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
Step1&lt;/h3&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
An Android project needs to be created and name it &quot;ChangeTheme&quot;. Now, do a right-click on the project. Select &quot;New -&amp;gt; Android XML File&quot;. The below dialog box will get open so that the name of the XML file can be given. Select Resource Type as &quot;Values&quot; and name of the file as &quot;style.xml&quot;.&lt;/div&gt;
&lt;img alt=&quot;Indicates the New Android Project to be created&quot; class=&quot;imagem_artigo&quot; src=&quot;http://videos.web-03.net/mrbool/articles/varun/ChangeTheme/ChangeTheme01.jpg&quot; style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot; /&gt;&lt;br /&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
&lt;strong style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;Figure 1&lt;/strong&gt;:Indicates the New Android Project to be created&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
Add the below code on opening that file:&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;resources&amp;gt;
    &amp;lt;style name=&quot;FirstTheme&quot; &amp;gt;
        &amp;lt;item name=&quot;android:textColor&quot;&amp;gt;#FF0000&amp;lt;/item&amp;gt;
    &amp;lt;/style&amp;gt;
    &amp;lt;style name=&quot;SecondTheme&quot; &amp;gt;
        &amp;lt;item name=&quot;android:textColor&quot;&amp;gt;#00FF00&amp;lt;/item&amp;gt;
    &amp;lt;/style&amp;gt;
    &amp;lt;style name=&quot;Thirdheme&quot; &amp;gt;
        &amp;lt;item name=&quot;android:textColor&quot;&amp;gt;#0000F0&amp;lt;/item&amp;gt;
    &amp;lt;/style&amp;gt;
&amp;lt;/resources&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
It can be seen that, we have created 3 styles namely &quot;FirstThem&quot;, &quot;SecondTheme&quot; and &quot;ThirdTheme&quot; with the same attribute &quot;Text Colour&quot;. However the colour values are different.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
Step 2&lt;/h3&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
Now open your &quot;main.xml&quot; layout file that is residing in &quot;res/layout&quot; directory.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
The following code needs to be entered in so as to add 3 buttons and 1 label in it.&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;fill_parent&quot;
    android:orientation=&quot;vertical&quot; &amp;gt;
    &amp;lt;TextView
        android:id=&quot;@+id/textView1&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Hello C-Sharp&quot;
 android:textAppearance=&quot;?android:attr/textAppearanceLarge&quot; /&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/button1&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;First Theme&quot; /&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/button2&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Second Theme&quot; /&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/button3&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Third Theme&quot; /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
After the completion of this code, you need to go to &quot;graphical&quot; view and the following screen will be displayed.&lt;/div&gt;
&lt;img alt=&quot;Indicates the screen post navigating to Graphical view&quot; class=&quot;imagem_artigo&quot; src=&quot;http://videos.web-03.net/mrbool/articles/varun/ChangeTheme/ChangeTheme02.gif&quot; style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot; /&gt;&lt;br /&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
&lt;strong style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;Figure 2&lt;/strong&gt;: Indicates the screen post navigating to Graphical view&lt;/div&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
Step3&lt;/h3&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
Open your activity file which in this case is the &quot;ChangeThemeActivity.java&quot; file. This file is located in the &quot;src/package&quot; directory.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
The buttons need to be bind and give “OnClickListener” so as to set the theme at runtime. Write the subsequent code in that file in order to do that.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
&lt;strong style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;Listing 1:&lt;/strong&gt;&amp;nbsp;ChangeThemeActivity.java&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
public class ChangeThemeActivity extends Activity implements OnClickListener
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        Utils.onActivityCreateSetTheme(this);
        setContentView(R.layout.main);
          
                    findViewById(R.id.button1).setOnClickListener(this);
          findViewById(R.id.button2).setOnClickListener(this);
          findViewById(R.id.button3).setOnClickListener(this);
    }
     @Override
     public void onClick(View v) 
     {
          // TODO Auto-generated method stub
          switch (v.getId())
          {
          case R.id.button1:
          Utils.changeToTheme(this, Utils.THEME_DEFAULT);
          break;
          case R.id.button2:
          Utils.changeToTheme(this, Utils.THEME_WHITE);
          break;
          case R.id.button3:
          Utils.changeToTheme(this, Utils.THEME_BLUE);
          break;
          }
     }
}

&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
Let us write the below code in the &quot;Utils&quot; file:&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
&lt;strong style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;Listing 2&lt;/strong&gt;: Utils.java&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-family: Verdana; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;import android.app.Activity;
import android.content.Intent;
public class Utils
{
     private static int sTheme;
     public final static int THEME_DEFAULT = 0;
     public final static int THEME_WHITE = 1;
     public final static int THEME_BLUE = 2;
     /**
      * Set the theme of the Activity, and restart it by creating a new Activity of the same type.
      */
     public static void changeToTheme(Activity activity, int theme)
     {
          sTheme = theme;
          activity.finish();
activity.startActivity(new Intent(activity, activity.getClass()));
     }
     /** Set the theme of the activity, according to the configuration. */
     public static void onActivityCreateSetTheme(Activity activity)
     {
          switch (sTheme)
          {
          default:
          case THEME_DEFAULT:
              activity.setTheme(R.style.FirstTheme);
              break;
          case THEME_WHITE:
              activity.setTheme(R.style.SecondTheme);
              break;
          case THEME_BLUE:
              activity.setTheme(R.style.Thirdheme);
              break;
          }
     }
}

&lt;/pre&gt;
&lt;/div&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
Description&lt;/h3&gt;
&lt;ol style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;
&lt;li style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;changeToTheme ( Activity activity, int theme )&lt;/li&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
There are two arguments in this method, one is &quot;Activity&quot;, that provides this method to identify the activity that has called this method and which theme to change. The other argument is “Theme&quot; id. This is already declared in the beginning of the class and is written below:&lt;/div&gt;
&lt;div class=&quot;div_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: #f7f7f7; border-left-color: rgb(0, 84, 94); border-left-style: solid; border-left-width: 4px; font-size: 10pt; line-height: 16pt; margin-bottom: 40px; margin-top: 10px; overflow-x: auto; padding-left: 5px;&quot;&gt;
&lt;pre class=&quot;pre_listagem&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;public final static int THEME_DEFAULT = 0;
public final static int THEME_WHITE = 1;
public final static int THEME_BLUE = 2;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
We declare three constants to identify each of them since we have 3 themes.&lt;/div&gt;
&lt;li style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;onActivityCreateSetTheme ( Activity activity )&lt;/li&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
The method holds the responsibility for setting the theme to the activity. After this, the method will verify which theme to set. It will identify the same by making use of a switch case and will call the &quot;setTheme&quot; method.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
Step 4&lt;/h3&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
We are prepared now to run the application. Before that, do have &quot;AVD&quot; (Android Virtual Device) added in your eclipse else go to &quot;Window -&amp;gt; AVD Manager&quot; and add a new AVD device to it.&lt;/div&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
To begin with the execution, right-click on your &quot;project&quot; and select &quot;Run As -&amp;gt; Android Application&quot; thereby making your application run in the emulator.&lt;/div&gt;
&lt;img alt=&quot;Both screens referring to the application executed in the emulator&quot; class=&quot;imagem_artigo&quot; src=&quot;http://videos.web-03.net/mrbool/articles/varun/ChangeTheme/ChangeTheme03.gif&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot; /&gt;&lt;br style=&quot;-webkit-tap-highlight-color: transparent;&quot; /&gt;&lt;img alt=&quot;Both screens referring to the application executed in the emulator&quot; class=&quot;imagem_artigo&quot; src=&quot;http://videos.web-03.net/mrbool/articles/varun/ChangeTheme/ChangeTheme04.gif&quot; style=&quot;-webkit-tap-highlight-color: transparent;&quot; /&gt;&lt;br style=&quot;-webkit-tap-highlight-color: transparent;&quot; /&gt;&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
&lt;strong style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;Figure 3&lt;/strong&gt;: Both screens referring to the application executed in the emulator&lt;/div&gt;
&lt;h3 style=&quot;-webkit-tap-highlight-color: transparent; color: #5b5b5b; font-family: Roboto, sans-serif; font-size: 1.8em; font-weight: 300; line-height: 50px; margin-bottom: -10px; margin-top: 40px;&quot;&gt;
Conclusion&lt;/h3&gt;
&lt;div style=&quot;-webkit-tap-highlight-color: transparent;&quot;&gt;
The tutorial briefed about the process to create styles, to use it as a theme of an application and finally on the way to alter the theme of an application at the time of execution.&lt;/div&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-tap-highlight-color: transparent; font-family: Verdana;&quot;&gt;&lt;br style=&quot;-webkit-tap-highlight-color: transparent;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/7708612556032678582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/08/how-to-change-layout-theme-of-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/7708612556032678582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/7708612556032678582'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/08/how-to-change-layout-theme-of-android.html' title='How to change the layout theme of an Android Application '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-3793496648333094940</id><published>2015-08-13T23:21:00.001-07:00</published><updated>2015-08-13T23:21:47.851-07:00</updated><title type='text'>finish activity when back button twice pressed? [duplicate]</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;1)&lt;/strong&gt;&amp;nbsp;Make a global vairable in your class like...&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; backPressedToExitOnce &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; toast &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;2)&lt;/strong&gt;&amp;nbsp;Then implement onBackPressed of activity like this...&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; onBackPressed&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;backPressedToExitOnce&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;onBackPressed&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;backPressedToExitOnce &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        showToast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;&quot;Press again to exit&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Handler&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;postDelayed&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;

            &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
                backPressedToExitOnce &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;2000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;3)&lt;/strong&gt;&amp;nbsp;Use this trick to handle this toast efficiantly...&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/**
 * Created to make sure that you toast doesn&#39;t show miltiple times, if user pressed back
 * button more than once. 
 * @param message Message to show on toast.
 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; showToast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;// Create toast if found null, it would he the case of first call only&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;makeText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;LENGTH_SHORT&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;

    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;// Toast not showing, so create new one&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;makeText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;Toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;LENGTH_SHORT&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;

    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;// Updating toast message is showing&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;setText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;

    &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;// Showing toast finally&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;4)&lt;/strong&gt;&amp;nbsp;And use this trick to hide toast when you activity is closed...&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/**
 * Kill the toast if showing. Supposed to call from onPause() of activity.
 * So that toast also get removed as activity goes to background, to improve
 * better app experiance for user
 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; killToast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;toast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;cancel&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;5)&lt;/strong&gt;&amp;nbsp;Implement you onPause() like that, to kill toast immidiatly as activity goes to background&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; onPause&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    killToast&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;onPause&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/3793496648333094940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/08/finish-activity-when-back-button-twice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/3793496648333094940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/3793496648333094940'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/08/finish-activity-when-back-button-twice.html' title='finish activity when back button twice pressed? [duplicate]'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-2162362985121925604</id><published>2015-07-21T21:55:00.001-07:00</published><updated>2015-07-21T21:55:29.301-07:00</updated><title type='text'>Refer Sri Lanka to International Criminal Court</title><content type='html'>&lt;a href=&quot;http://tgte-icc.org/#.Va8iOTFZW30.blogger&quot;&gt;Refer Sri Lanka to International Criminal Court&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/2162362985121925604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/07/refer-sri-lanka-to-international.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/2162362985121925604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/2162362985121925604'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/07/refer-sri-lanka-to-international.html' title='Refer Sri Lanka to International Criminal Court'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-8088763287556808873</id><published>2015-07-20T21:42:00.001-07:00</published><updated>2015-11-24T20:53:42.699-08:00</updated><title type='text'>Android ActionBar Tab Color</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For anyone wants to change actionbar color/background in code, you can do something like this&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;ActionBar&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; actionBar &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; getActionBar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
actionBar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;setBackgroundDrawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getDrawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;drawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;action_bar_bg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
To change the tab bar color under the actionbar:&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;actionBar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;setStackedBackgroundDrawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; margin: 0px; padding: 0px;&quot;&gt;ColorDrawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getColor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;color_brown_dark&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;)));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; color: #222222; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;&quot;&gt;
To change tab bar background:&lt;/div&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;actionBar&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;setStackedBackgroundDrawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;getDrawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
            R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;drawable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;coupon_header&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; color: #393318; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; color: black; margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/8088763287556808873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/07/android-actionbar-tab-color.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8088763287556808873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8088763287556808873'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/07/android-actionbar-tab-color.html' title='Android ActionBar Tab Color'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-4820532686386757281</id><published>2015-07-20T00:08:00.001-07:00</published><updated>2015-07-20T00:08:20.335-07:00</updated><title type='text'>GridView with Auto Resized Images on Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg08q2dUOsPl-cL4YKB73KERg_jZRhKx_jroyXsKvbxXjUZ97jsEqDaUOG9i5hQQtVNMIisGY8fd28ij1FKYkMNrWR04TksO8d7prtE51xeqBA1vCqJogtqQP0yQ8IS-5f7Jcwkb3fZ2dnL/s1600/device-2015-07-20-123243.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg08q2dUOsPl-cL4YKB73KERg_jZRhKx_jroyXsKvbxXjUZ97jsEqDaUOG9i5hQQtVNMIisGY8fd28ij1FKYkMNrWR04TksO8d7prtE51xeqBA1vCqJogtqQP0yQ8IS-5f7Jcwkb3fZ2dnL/s320/device-2015-07-20-123243.png&quot; width=&quot;187&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; color: #333333; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 13px; line-height: 1.42857143; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;FrameLayout&lt;/span&gt; 
    &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;xmlns:android=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;GridView&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:id=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;@+id/gridview&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:verticalSpacing=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:horizontalSpacing=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:stretchMode=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;columnWidth&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:numColumns=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/FrameLayout&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; color: #333333; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 13px; line-height: 1.42857143; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;div class=&quot;codehilite&quot; style=&quot;background-color: #fefefe; box-sizing: border-box; font-family: &#39;Open Sans&#39;, arial, sans-serif; font-size: 14px; line-height: 20px; white-space: normal;&quot;&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 13px; line-height: 1.42857143; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;&quot;&gt;package com.rogcg.gridviewexample;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

public class SquareImageView extends ImageView
{
    public SquareImageView(Context context)
    {
        super(context);
    }

    public SquareImageView(Context context, AttributeSet attrs)
    {
        super(context, attrs);
    }

    public SquareImageView(Context context, AttributeSet attrs, int defStyle)
    {
        super(context, attrs, defStyle);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
    {
       Context context=getContext();
     
     WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
     Display display = wm.getDefaultDisplay();
     
     Point size = new Point();
     display.getSize(size);
     int width = size.x;
     int height = size.y-80;

        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        //setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); //Snap to width
        if(Config.orientation==1)
        setMeasuredDimension(getMeasuredWidth(), height/3); //Snap to width
        else
         setMeasuredDimension(getMeasuredWidth(), height/2); //Snap to width   }
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #fefefe; box-sizing: border-box; font-family: &#39;Open Sans&#39;, arial, sans-serif; font-size: 14px; line-height: 20px; margin-bottom: 10px; white-space: normal;&quot;&gt;
And now we make a layout for a grid item using this&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;SquareImageView&lt;/span&gt;&amp;nbsp;class and set the&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;scaleType&lt;/em&gt;&amp;nbsp;to&amp;nbsp;&lt;code style=&quot;background-color: #f9f2f4; border-radius: 4px; box-sizing: border-box; color: #c7254e; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 12.6000003814697px; padding: 2px 4px; white-space: nowrap;&quot;&gt;centerCrop&lt;/code&gt;. Let&#39;s call this file&lt;code style=&quot;background-color: #f9f2f4; border-radius: 4px; box-sizing: border-box; color: #c7254e; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 12.6000003814697px; padding: 2px 4px; white-space: nowrap;&quot;&gt;gridview_item.xml&lt;/code&gt;.&lt;/div&gt;
&lt;div class=&quot;codehilite&quot; style=&quot;background-color: #fefefe; box-sizing: border-box; font-family: &#39;Open Sans&#39;, arial, sans-serif; font-size: 14px; line-height: 20px; white-space: normal;&quot;&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 13px; line-height: 1.42857143; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;FrameLayout&lt;/span&gt; &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;xmlns:android=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;com.rogcg.gridviewexample.SquareImageView&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:id=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;@+id/picture&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:scaleType=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;centerCrop&quot;&lt;/span&gt;
        &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;TextView&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:id=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;@+id/text&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_width=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_height=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:paddingLeft=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:paddingRight=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:paddingTop=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;15dp&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:paddingBottom=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;15dp&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:layout_gravity=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;bottom&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:textColor=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;@android:color/white&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot; style=&quot;box-sizing: border-box;&quot;&gt;android:background=&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;#55000000&quot;&lt;/span&gt;
        &lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;&amp;lt;/FrameLayout&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box; line-height: 18.5714282989502px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Menlo, Monaco, Consolas, Courier New, monospace;&quot;&gt;package com.mafiree;

import java.util.ArrayList;
import java.util.List;

import com.mafiree.source.Config;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

public class DashBoard extends Activity{

 @Override
 protected void onCreate(Bundle savedInstanceState) {  
  super.onCreate(savedInstanceState);
  setContentView(R.layout.dash_board_demo);
  Config.orientation=getScreenOrientation();
   GridView gridView = (GridView)findViewById(R.id.gridview);
         gridView.setAdapter(new MyAdapter(this));
  //String[] name={&quot;Current Health&quot;,&quot;Outstanding Issues&quot;,&quot;Architecture&quot;,&quot;Tickets&quot;,&quot;Backup&quot;,&quot;Activity&quot;};
 }
 
  private class MyAdapter extends BaseAdapter
     {
         private List&amp;lt;Item&amp;gt; items = new ArrayList&amp;lt;Item&amp;gt;();
         private LayoutInflater inflater;

         public MyAdapter(Context context)
         {
             inflater = LayoutInflater.from(context);

             items.add(new Item(&quot;Current Health&quot;, R.drawable.test));
             items.add(new Item(&quot;Outstanding Issues&quot;, R.drawable.test));
             items.add(new Item(&quot;Architecture&quot;, R.drawable.test));
             items.add(new Item(&quot;Tickets&quot;, R.drawable.test));
             items.add(new Item(&quot;Backup&quot;, R.drawable.test));
             items.add(new Item(&quot;Activity&quot;, R.drawable.test));
         }

         @Override
         public int getCount() {
             return items.size();
         }

         @Override
         public Object getItem(int i)
         {
             return items.get(i);
         }

         @Override
         public long getItemId(int i)
         {
             return items.get(i).drawableId;
         }

         @SuppressLint(&quot;NewApi&quot;)
   @Override
         public View getView(int i, View view, ViewGroup viewGroup)
         {
             View v = view;
             ImageView picture;
             TextView name;

             if(v == null)
             {
                v = inflater.inflate(R.layout.gridview_item, viewGroup, false);
                v.setTag(R.id.picture, v.findViewById(R.id.picture));
                v.setTag(R.id.text, v.findViewById(R.id.text));
             }

             picture = (ImageView)v.getTag(R.id.picture);
             name = (TextView)v.getTag(R.id.text);

             Item item = (Item)getItem(i);

             Display display = getWindowManager().getDefaultDisplay();
             Point size = new Point();
             display.getSize(size);
             int width = size.x;
             int height = size.y;
             
             int orentation=getScreenOrientation();
             System.out.println(&quot;orientation: &quot;+getScreenOrientation());
             // picture.getLayoutParams().height = 20;
             //  picture.requestLayout();
            DashBoard.this.getResources().getConfiguration();
             System.out.println();
             android.view.ViewGroup.LayoutParams layoutParams = picture.getLayoutParams();
             if(orentation==2){
             layoutParams.width = width/3;
             layoutParams.height = 50;
             picture.setLayoutParams(layoutParams);
             System.out.println(&quot;setting orientation&quot;);
             }else{
              System.out.println(&quot;nothing&quot;);
             }
             
             
             
             System.out.println(&quot;width :&quot;+width);
             System.out.println(&quot;height :&quot;+height);
             picture.setImageResource(item.drawableId);
             name.setText(item.name);

             
             picture.setId(i);
             picture.setOnClickListener(new OnClickListener() {
     
     @Override
     public void onClick(View v) {
      Toast.makeText(getApplicationContext(), &quot;click-&quot;+v.getId(), Toast.LENGTH_SHORT).show();
     }
    });
             
             return v;
         }

         private class Item
         {
             final String name;
             final int drawableId;

             Item(String name, int drawableId)
             {
                 this.name = name;
                 this.drawableId = drawableId;
             }
         }

  
     }
  
  
  public int getScreenOrientation()
  {
      Display getOrient = getWindowManager().getDefaultDisplay();
      int orientation = Configuration.ORIENTATION_UNDEFINED;
      if(getOrient.getWidth()==getOrient.getHeight()){
          orientation = Configuration.ORIENTATION_SQUARE;
      } else{ 
          if(getOrient.getWidth() &amp;lt; getOrient.getHeight()){
              orientation = Configuration.ORIENTATION_PORTRAIT;
          }else { 
               orientation = Configuration.ORIENTATION_LANDSCAPE;
          }
      }
      return orientation;
  }
 }&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-sizing: border-box; color: #333333; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 13px; line-height: 1.42857143; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;nt&quot; style=&quot;box-sizing: border-box;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/4820532686386757281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/07/gridview-with-auto-resized-images-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/4820532686386757281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/4820532686386757281'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/07/gridview-with-auto-resized-images-on.html' title='GridView with Auto Resized Images on Android'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg08q2dUOsPl-cL4YKB73KERg_jZRhKx_jroyXsKvbxXjUZ97jsEqDaUOG9i5hQQtVNMIisGY8fd28ij1FKYkMNrWR04TksO8d7prtE51xeqBA1vCqJogtqQP0yQ8IS-5f7Jcwkb3fZ2dnL/s72-c/device-2015-07-20-123243.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-9204989560560376922</id><published>2015-05-28T02:28:00.001-07:00</published><updated>2015-05-28T02:28:29.773-07:00</updated><title type='text'>Android play song continuously(ArrayList) in service </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
package com.source;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
&lt;br /&gt;
import android.app.Service;&lt;br /&gt;
import android.content.Context;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.drm.DrmStore.Playback;&lt;br /&gt;
import android.media.AudioManager;&lt;br /&gt;
import android.media.MediaPlayer;&lt;br /&gt;
import android.media.MediaPlayer.OnCompletionListener;&lt;br /&gt;
import android.net.Uri;&lt;br /&gt;
import android.os.IBinder;&lt;br /&gt;
import android.os.PowerManager;&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
public class MyService extends Service implements OnCompletionListener,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener{&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Context context;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String ACTION_PLAY = &quot;PLAY&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String TAG = &quot;SONG SERVICE&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MediaPlayer mediaPlayer;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private int currentTrack = 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ArrayList&amp;lt;String&amp;gt; list;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public MyService() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;context=getBaseContext();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public IBinder onBind(Intent intent) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw new UnsupportedOperationException(&quot;Not yet implemented&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int onStartCommand(Intent intent, int flags, int startId) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;list = (ArrayList&amp;lt;String&amp;gt;)intent.getSerializableExtra(&quot;arraylist&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int count=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(TAG, &quot;total count:&quot;+list.size());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//playing song one by one&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (String string : list) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//play(string);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;count++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(TAG, &quot;count:&quot;+list);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;play(currentTrack);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(TAG, &quot;count:&quot;+count);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(count==list.size()){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//stopSelf();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(TAG, &quot;stoping service&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//mediaPlayer.setOnCompletionListener(this);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}else{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(TAG, &quot;not stoping service&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (!mediaPlayer.isPlaying()) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mediaPlayer.start();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(TAG, &quot;oncommat&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return START_STICKY;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onCreate() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Toast.makeText(this, &quot;Service was Created&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onStart(Intent intent, int startId) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Perform your long running operations here.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Toast.makeText(this, &quot;Service Started&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onDestroy() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Toast.makeText(this, &quot;Service Destroyed&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(&quot;service&quot;, &quot;destroyed&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (mediaPlayer.isPlaying()) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;mediaPlayer.stop();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;mediaPlayer.release();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public boolean onError(MediaPlayer mp, int what, int extra) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return false;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onPrepared(MediaPlayer mp) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void play(int id) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(mediaPlayer!=null &amp;amp;&amp;amp; mediaPlayer.isPlaying()){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(&quot;*****begin*****&quot;, &quot;playing&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;stopPlaying();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; Log.d(&quot;*****begin*****&quot;, &quot;stoping&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;else{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; Log.d(&quot;*****begin*****&quot;, &quot;nothing&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(&quot;*****play count*****&quot;, &quot;=&quot;+currentTrack);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.i(&quot;******playing&quot;, list.get(currentTrack));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Uri myUri1 = Uri.parse(list.get(id));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer = new MediaPlayer();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer.setOnPreparedListener(this);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//mediaPlayer.setOnCompletionListener(this);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer.setOnErrorListener(this);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mediaPlayer.setDataSource(context, myUri1);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.i(&quot;******playing&quot;, myUri1.getPath());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (IllegalArgumentException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(context, &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (SecurityException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(context, &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IllegalStateException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(context, &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mediaPlayer.prepare();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IllegalStateException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(context, &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(context, &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer.setOnCompletionListener(new OnCompletionListener() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onCompletion(MediaPlayer mp) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;currentTrack=currentTrack+1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;play(currentTrack);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;/* currentTrack = (currentTrack + 1) % list.size();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; Uri nextTrack=Uri.parse(list.get(currentTrack));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt; mediaPlayer.setDataSource(context,nextTrack);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt; mediaPlayer.prepare();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;// mediaPlayer.start();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;} catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;e.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}*/&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mediaPlayer.start();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void stopPlaying() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mediaPlayer != null) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mediaPlayer.stop();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mediaPlayer.release();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mediaPlayer = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onCompletion(MediaPlayer mp) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
call the service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
stopService();&lt;br /&gt;
startService(getSongsFromAlbum(v.getTag().toString()));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void startService(ArrayList&amp;lt;String&amp;gt; list) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Intent intent=new Intent(getActivity(),MyService.class);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;intent.putExtra(&quot;arraylist&quot;, list);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;getActivity().startService(intent);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void stopService() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;getActivity().stopService(new Intent(getActivity(),MyService.class));&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/9204989560560376922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/05/android-play-song-continuouslyarraylist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/9204989560560376922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/9204989560560376922'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/05/android-play-song-continuouslyarraylist.html' title='Android play song continuously(ArrayList) in service '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6368102395123826010.post-8722350070362630336</id><published>2015-05-22T04:35:00.000-07:00</published><updated>2015-05-22T04:40:53.923-07:00</updated><title type='text'>Swipable Tabs changing app icon as well as tab icon</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;SongGalleryActivity .java&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
package com.mtag;&lt;br /&gt;
&lt;br /&gt;
import com.util.NotificationPanel;&lt;br /&gt;
&lt;br /&gt;
import android.annotation.SuppressLint;&lt;br /&gt;
import android.annotation.TargetApi;&lt;br /&gt;
import android.app.ActionBar;&lt;br /&gt;
import android.app.ActionBar.Tab;&lt;br /&gt;
import android.app.FragmentTransaction;&lt;br /&gt;
import android.content.Intent;&lt;br /&gt;
import android.graphics.drawable.ColorDrawable;&lt;br /&gt;
import android.os.Build;&lt;br /&gt;
import android.os.Bundle;&lt;br /&gt;
import android.support.v4.app.FragmentActivity;&lt;br /&gt;
import android.support.v4.view.ViewPager;&lt;br /&gt;
import android.util.Log;&lt;br /&gt;
import android.view.LayoutInflater;&lt;br /&gt;
import android.view.Menu;&lt;br /&gt;
import android.view.View;&lt;br /&gt;
import android.widget.Toast;&lt;br /&gt;
&lt;br /&gt;
@SuppressLint(&quot;NewApi&quot;)&lt;br /&gt;
public class SongGalleryActivity extends FragmentActivity &amp;nbsp;implements&lt;br /&gt;
ActionBar.TabListener {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int backButtonCount=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private ViewPager viewPager;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private TabsPagerAdapter mAdapter;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private android.app.ActionBar actionBar;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Tab titles&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private String[] tabs = { &quot;Genres&quot;, &quot;Artists&quot;, &quot;Albums&quot;,&quot;Songs&quot;,&quot;PlayLists&quot; };&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final int[] ICONS = new int[] {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.genre_inactive,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.artist_inactive,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.albums_inactive,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.songs_inactive,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.lists_inactive,&lt;br /&gt;
};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final int[] ICONS_SELECTED = new int[] {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.genre_active,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.artist_active,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.albums_active,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.songs_active,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R.drawable.lists_active,&lt;br /&gt;
};&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@TargetApi(Build.VERSION_CODES.HONEYCOMB)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SuppressLint(&quot;NewApi&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super.onCreate(savedInstanceState);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setContentView(R.layout.activity_song_gallery);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String val=getIntent().getStringExtra(&quot;DO&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(&quot;value..............&quot;, &quot;::::&quot;+val);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; // Initilization&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; viewPager = (ViewPager) findViewById(R.id.pager);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar = getActionBar();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mAdapter = new TabsPagerAdapter(getSupportFragmentManager());&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; viewPager.setAdapter(mAdapter);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setHomeButtonEnabled(false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LayoutInflater mInflater = LayoutInflater.from(this);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; View mCustomView = mInflater.inflate(R.layout.custom_actionbar, null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setCustomView(mCustomView);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setDisplayShowCustomEnabled(true);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
/* &amp;nbsp; &amp;nbsp; // Adding Tabs&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (String tab_name : tabs) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.addTab(actionBar.newTab().setText(tab_name)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .setTabListener(this));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // instead of NewsFeedActivity you have to use your activity name here &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i=0; i &amp;lt; tabs.length; i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.addTab(actionBar.newTab().setText(tabs[i])&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.setIcon(SongGalleryActivity.this.getResources().getDrawable(ICONS[i]))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.setTabListener(this));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }//endfor&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setStackedBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.white)));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//actionBar.setStackedBackgroundDrawable(getResources().getDrawable(R.color.white));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* on swiping the viewpager make respective tab selected&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* */&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onPageSelected(int position) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // on changing the page&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // make respected tab selected&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setSelectedNavigationItem(position);&lt;br /&gt;
&amp;nbsp;//actionBar.setIcon(ICONS_SELECTED[position]);// this is for changing logo in the applcation also&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onPageScrolled(int arg0, float arg1, int arg2) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onPageScrollStateChanged(int arg0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onTabReselected(Tab arg0, FragmentTransaction arg1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@SuppressLint(&quot;NewApi&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onTabSelected(Tab tab, FragmentTransaction arg1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; viewPager.setCurrentItem(tab.getPosition());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; tab.setIcon(ICONS_SELECTED[tab.getPosition()]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onTabUnselected(Tab tab, FragmentTransaction arg1) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; tab.setIcon(ICONS[tab.getPosition()]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public boolean onCreateOptionsMenu(Menu menu) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;getMenuInflater().inflate(R.menu.main, menu);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return super.onCreateOptionsMenu(menu);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onBackPressed() {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(backButtonCount &amp;gt;= 1)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;NotificationPanel notificationPanel=new NotificationPanel(this);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;notificationPanel.notificationCancel();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intent intent = new Intent(Intent.ACTION_MAIN);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intent.addCategory(Intent.CATEGORY_HOME);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;startActivity(intent);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(this, &quot;Press the back button once again to close the application.&quot;, Toast.LENGTH_SHORT).show();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;backButtonCount++;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;Note :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;actionBar.setIcon(ICONS_SELECTED[position]);// this is for changing logo in the applcation also&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #660000;&quot;&gt;if u add this&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp;public void onPageSelected(int position) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // on changing the page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // make respected tab selected&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; actionBar.setSelectedNavigationItem(position);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;actionBar.setIcon(ICONS_SELECTED[position]);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: #660000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6;&quot;&gt;&lt;span style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;color: #660000;&quot;&gt;the application icon also will changed&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TabsPagerAdapter .java&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
package com.mtag;&lt;br /&gt;
&lt;br /&gt;
import com.viewpagerindicator.IconPagerAdapter;&lt;br /&gt;
&lt;br /&gt;
import android.support.v4.app.Fragment;&lt;br /&gt;
import android.support.v4.app.FragmentManager;&lt;br /&gt;
import android.support.v4.app.FragmentPagerAdapter;&lt;br /&gt;
&lt;br /&gt;
public class TabsPagerAdapter extends FragmentPagerAdapter implements IconPagerAdapter {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public TabsPagerAdapter(FragmentManager fm) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super(fm);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated constructor stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public Fragment getItem(int index) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;switch (index) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 0:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Genres fragment activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new GenresFragment();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 1:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Artist fragment activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new ArtistsFragment();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 2:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // ALbum fragment activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new AlbumsFragment();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 4:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Playlist fragment activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new PlaylistFragment();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 3:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // ALbum fragment activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new SongsFragment();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int getCount() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return 5;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int getIconResIdNormal(int index) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int getIconResIdSelected(int index) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int getBackgroundResIdSelected(int index) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int getBackgroundResIdNormal(int index) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;fragment&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
package com.mtag;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import java.io.IOException;&lt;/div&gt;
&lt;div&gt;
import java.util.ArrayList;&lt;/div&gt;
&lt;div&gt;
import java.util.Collections;&lt;/div&gt;
&lt;div&gt;
import java.util.Comparator;&lt;/div&gt;
&lt;div&gt;
import java.util.HashMap;&lt;/div&gt;
&lt;div&gt;
import java.util.Set;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import android.annotation.TargetApi;&lt;/div&gt;
&lt;div&gt;
import android.content.ContentResolver;&lt;/div&gt;
&lt;div&gt;
import android.content.Context;&lt;/div&gt;
&lt;div&gt;
import android.database.Cursor;&lt;/div&gt;
&lt;div&gt;
import android.media.AudioManager;&lt;/div&gt;
&lt;div&gt;
import android.media.MediaPlayer;&lt;/div&gt;
&lt;div&gt;
import android.net.Uri;&lt;/div&gt;
&lt;div&gt;
import android.os.Build;&lt;/div&gt;
&lt;div&gt;
import android.os.Bundle;&lt;/div&gt;
&lt;div&gt;
import android.support.v4.app.Fragment;&lt;/div&gt;
&lt;div&gt;
import android.util.Log;&lt;/div&gt;
&lt;div&gt;
import android.view.LayoutInflater;&lt;/div&gt;
&lt;div&gt;
import android.view.View;&lt;/div&gt;
&lt;div&gt;
import android.view.View.OnClickListener;&lt;/div&gt;
&lt;div&gt;
import android.view.ViewGroup;&lt;/div&gt;
&lt;div&gt;
import android.widget.ArrayAdapter;&lt;/div&gt;
&lt;div&gt;
import android.widget.LinearLayout;&lt;/div&gt;
&lt;div&gt;
import android.widget.ListView;&lt;/div&gt;
&lt;div&gt;
import android.widget.SectionIndexer;&lt;/div&gt;
&lt;div&gt;
import android.widget.TextView;&lt;/div&gt;
&lt;div&gt;
import android.widget.Toast;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import com.source.Song;&lt;/div&gt;
&lt;div&gt;
import com.util.NotificationPanel;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)&lt;/div&gt;
&lt;div&gt;
public class SongsFragment extends Fragment{&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;LayoutInflater inflater;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ListView listView;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;View rootView;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private ArrayList&amp;lt;Song&amp;gt; songList;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ArtistsAdapter adapter;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MediaPlayer mediaPlayer;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public View onCreateView(LayoutInflater inflater, ViewGroup container,&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Bundle savedInstanceState) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.inflater=inflater;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;View rootView = inflater.inflate(R.layout.fragment_songs, container, false); &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.rootView=rootView;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; this.inflater=inflater;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; GUI();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return rootView;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
private void GUI() {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String val=getActivity().getIntent().getStringExtra(&quot;DO&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Log.d(&quot;value..............&quot;, &quot;::::&quot;+val);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;listView=(ListView)rootView.findViewById(R.id.listViewSongs);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;songList = new ArrayList&amp;lt;Song&amp;gt;();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//get songs from device&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;getSongList();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//sort alphabetically by title&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Collections.sort(songList, new Comparator&amp;lt;Song&amp;gt;(){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public int compare(Song a, Song b){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;return a.getTitle().compareTo(b.getTitle());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;fillAdapter();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//create and set adapter&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;/*com.source.SongAdapter adapter=new com.source.SongAdapter(getActivity(), songList);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;listView.setAdapter(adapter);*/&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void fillAdapter() {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if(null != songList || songList.size() &amp;gt; 0){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;adapter=new ArtistsAdapter(getActivity());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;listView.setAdapter(adapter);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;class ArtistsAdapter extends ArrayAdapter implements SectionIndexer{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Context context;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; HashMap&amp;lt;String, Integer&amp;gt; alphaIndexer;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String[] sections;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public ArtistsAdapter(Context context) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;super(context, R.layout.row_song_song, songList);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;this.context = context;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; alphaIndexer = new HashMap&amp;lt;String, Integer&amp;gt;();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int size = songList.size();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for (int x = 0; x &amp;lt; size; x++) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Song s = songList.get(x);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// get the first letter of the store&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String ch = &amp;nbsp;s.getAlbum().substring(0, 1);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// convert to uppercase otherwise lowercase a -z will be sorted after upper A-Z&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ch = ch.toUpperCase();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// HashMap will prevent duplicates&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alphaIndexer.put(ch, x);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Set&amp;lt;String&amp;gt; sectionLetters = alphaIndexer.keySet();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp;// create a list from the set to sort&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ArrayList&amp;lt;String&amp;gt; sectionList = new ArrayList&amp;lt;String&amp;gt;(sectionLetters);&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Collections.sort(sectionList);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sections = new String[sectionList.size()];&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sectionList.toArray(sections);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public View getView(final int position, View convertView,&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ViewGroup parent) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;final Holder holder;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (convertView == null) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;holder = new Holder();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;convertView = (LinearLayout) LayoutInflater.from(context)&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;.inflate(R.layout.row_song_song, null);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;holder.texSongName=(TextView)convertView.findViewById(R.id.song_title);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;holder.textSongDetail=(TextView)convertView.findViewById(R.id.song_data);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;holder.layout=(LinearLayout)convertView.findViewById(R.id.song_layout);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;convertView.setTag(holder);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;} else {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;holder = (Holder) convertView.getTag();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;holder.layout.setTag(songList.get(position).getData());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;holder.texSongName.setText(songList.get(position).getTitle());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;holder.textSongDetail.setText(songList.get(position).getArtist());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//holder.texSongName.setTag(songList.get(position).getData());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;holder.layout.setOnClickListener(new OnClickListener() {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;public void onClick(View v) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;play(v.getTag().toString());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;//&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Log.d(&quot;id&quot;, &quot;:&quot;+v.getId());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Toast.makeText(getContext(), &quot;clicked&quot;+v.getTag().toString(), Toast.LENGTH_SHORT).show();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;});&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return convertView;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;class Holder{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;TextView texSongName,textSongDetail;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;LinearLayout layout;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public Object[] getSections() {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// TODO Auto-generated method stub&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return sections;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; public int getPositionForSection(int section) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return alphaIndexer.get(sections[section]);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;@Override&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public int getSectionForPosition(int position) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// TODO Auto-generated method stub&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return 1;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int count=0;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String playFile;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void play(String path) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;count++;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;playFile=path;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//showNotification();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;new NotificationPanel(getActivity());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(mediaPlayer!=null &amp;amp;&amp;amp; mediaPlayer.isPlaying()){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Log.d(&quot;*****begin*****&quot;, &quot;playing&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;stopPlaying();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; Log.d(&quot;*****begin*****&quot;, &quot;stoping&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;else{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; Log.d(&quot;*****begin*****&quot;, &quot;nothing&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Uri myUri1 = Uri.parse(path);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer = new MediaPlayer();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mediaPlayer.setDataSource(getActivity(), myUri1);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (IllegalArgumentException e) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(getActivity(), &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (SecurityException e) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(getActivity(), &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IllegalStateException e) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(getActivity(), &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mediaPlayer.prepare();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IllegalStateException e) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(getActivity(), &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IOException e) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toast.makeText(getActivity(), &quot;You might not set the URI correctly!&quot;, Toast.LENGTH_LONG).show();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mediaPlayer.start();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void stopPlaying() {&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mediaPlayer != null) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mediaPlayer.stop();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mediaPlayer.release();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mediaPlayer = null;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//method to retrieve song info from deviceyyyy&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public void getSongList(){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//query external audio&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ContentResolver musicResolver = getActivity().getContentResolver();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//iterate over results if valid&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(musicCursor!=null &amp;amp;&amp;amp; musicCursor.moveToFirst()){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;//get columns&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int titleColumn = musicCursor.getColumnIndex&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;(android.provider.MediaStore.Audio.Media.TITLE);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int idColumn = musicCursor.getColumnIndex&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;(android.provider.MediaStore.Audio.Media._ID);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int artistColumn = musicCursor.getColumnIndex&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;(android.provider.MediaStore.Audio.Media.ARTIST);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int albumColumn = musicCursor.getColumnIndex&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;(android.provider.MediaStore.Audio.Media.ALBUM);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int trackColumn = musicCursor.getColumnIndex&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;(android.provider.MediaStore.Audio.Media.TRACK);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int dataColumn = musicCursor.getColumnIndex&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;(android.provider.MediaStore.Audio.Media.DATA);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;//add songs to list&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;do {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;long thisId = musicCursor.getLong(idColumn);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String thisTitle = musicCursor.getString(titleColumn);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String thisArtist = musicCursor.getString(artistColumn);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String thisAlbum = musicCursor.getString(albumColumn);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String thisTrack = musicCursor.getString(trackColumn);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;String thisData = musicCursor.getString(dataColumn);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;songList.add(new Song(thisId, thisTitle, thisArtist,thisAlbum,thisTrack,thisData));&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;while (musicCursor.moveToNext());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidjug.blogspot.com/feeds/8722350070362630336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidjug.blogspot.com/2015/05/swipable-tabs-changing-app-icon-as-well.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8722350070362630336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6368102395123826010/posts/default/8722350070362630336'/><link rel='alternate' type='text/html' href='http://androidjug.blogspot.com/2015/05/swipable-tabs-changing-app-icon-as-well.html' title='Swipable Tabs changing app icon as well as tab icon'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16068739871986182933</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>