{"id":127,"date":"2018-01-04T16:27:59","date_gmt":"2018-01-04T15:27:59","guid":{"rendered":"https:\/\/www.cipv6.de\/worp\/?p=127"},"modified":"2018-01-04T16:27:59","modified_gmt":"2018-01-04T15:27:59","slug":"android-log-or-toast-the-selected-item-in-an-listview","status":"publish","type":"post","link":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/","title":{"rendered":"Android: Log or Toast the selected Item in an ListView"},"content":{"rendered":"<p>in case you have the need to log.i the selected item of an listview this snippet could help:<\/p>\n<p>&nbsp;<\/p>\n<p>[java]<\/p>\n<p>listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {<br \/>\n    @Override<br \/>\n    public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {<br \/>\n        CheckedTextView checkedTextView = (CheckedTextView) view;<\/p>\n<p>        String itemClicked = (String) listView.getAdapter().getItem(i);<\/p>\n<p>        if (checkedTextView.isChecked()) {<br \/>\n            Log.i(&quot;Info :&quot;,  itemClicked + &quot; is checked&quot;);<br \/>\n            Toast.makeText(UsersActivity.this, itemClicked + &quot; is checked&quot;, Toast.LENGTH_SHORT).show();<br \/>\n        } else {<br \/>\n            Log.i(&quot;Info :&quot;,   itemClicked + &quot; is NOT Checked&quot;);<br \/>\n            Toast.makeText(UsersActivity.this, itemClicked + &quot; is NOT checked&quot;, Toast.LENGTH_SHORT).show();<br \/>\n        }<br \/>\n    }<br \/>\n[\/java]<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>in case you have the need to log.i the selected item of an listview this snippet could help: &nbsp; [java] listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) { CheckedTextView checkedTextView = (CheckedTextView) view; String itemClicked = (String) listView.getAdapter().getItem(i); if (checkedTextView.isChecked()) { Log.i(&quot;Info :&quot;, itemClicked + &quot; is checked&quot;); &hellip; <a href=\"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Android: Log or Toast the selected Item in an ListView&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[39,59],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-android","tag-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android: Log or Toast the selected Item in an ListView - cipv6.de<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android: Log or Toast the selected Item in an ListView - cipv6.de\" \/>\n<meta property=\"og:description\" content=\"in case you have the need to log.i the selected item of an listview this snippet could help: &nbsp; [java] listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) { CheckedTextView checkedTextView = (CheckedTextView) view; String itemClicked = (String) listView.getAdapter().getItem(i); if (checkedTextView.isChecked()) { Log.i(&quot;Info :&quot;, itemClicked + &quot; is checked&quot;); &hellip; Continue reading &quot;Android: Log or Toast the selected Item in an ListView&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/\" \/>\n<meta property=\"og:site_name\" content=\"cipv6.de\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-04T15:27:59+00:00\" \/>\n<meta name=\"author\" content=\"ugu5ma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ugu5ma\" \/>\n<meta name=\"twitter:site\" content=\"@ugu5ma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ugu5ma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/\"},\"author\":{\"name\":\"ugu5ma\",\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/#\\\/schema\\\/person\\\/5d62b275485540be9e5e9e33d4fab86d\"},\"headline\":\"Android: Log or Toast the selected Item in an ListView\",\"datePublished\":\"2018-01-04T15:27:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/\"},\"wordCount\":115,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/#\\\/schema\\\/person\\\/5d62b275485540be9e5e9e33d4fab86d\"},\"keywords\":[\"Android\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/\",\"url\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/\",\"name\":\"Android: Log or Toast the selected Item in an ListView - cipv6.de\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/#website\"},\"datePublished\":\"2018-01-04T15:27:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/index.php\\\/2018\\\/01\\\/04\\\/android-log-or-toast-the-selected-item-in-an-listview\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android: Log or Toast the selected Item in an ListView\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/#website\",\"url\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/\",\"name\":\"cipv6.de\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/#\\\/schema\\\/person\\\/5d62b275485540be9e5e9e33d4fab86d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.cipv6.de\\\/worp\\\/#\\\/schema\\\/person\\\/5d62b275485540be9e5e9e33d4fab86d\",\"name\":\"ugu5ma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g\",\"caption\":\"ugu5ma\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/cipv6.de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android: Log or Toast the selected Item in an ListView - cipv6.de","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/","og_locale":"en_US","og_type":"article","og_title":"Android: Log or Toast the selected Item in an ListView - cipv6.de","og_description":"in case you have the need to log.i the selected item of an listview this snippet could help: &nbsp; [java] listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) { CheckedTextView checkedTextView = (CheckedTextView) view; String itemClicked = (String) listView.getAdapter().getItem(i); if (checkedTextView.isChecked()) { Log.i(&quot;Info :&quot;, itemClicked + &quot; is checked&quot;); &hellip; Continue reading \"Android: Log or Toast the selected Item in an ListView\"","og_url":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/","og_site_name":"cipv6.de","article_published_time":"2018-01-04T15:27:59+00:00","author":"ugu5ma","twitter_card":"summary_large_image","twitter_creator":"@ugu5ma","twitter_site":"@ugu5ma","twitter_misc":{"Written by":"ugu5ma","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/#article","isPartOf":{"@id":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/"},"author":{"name":"ugu5ma","@id":"https:\/\/www.cipv6.de\/worp\/#\/schema\/person\/5d62b275485540be9e5e9e33d4fab86d"},"headline":"Android: Log or Toast the selected Item in an ListView","datePublished":"2018-01-04T15:27:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/"},"wordCount":115,"commentCount":0,"publisher":{"@id":"https:\/\/www.cipv6.de\/worp\/#\/schema\/person\/5d62b275485540be9e5e9e33d4fab86d"},"keywords":["Android"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/","url":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/","name":"Android: Log or Toast the selected Item in an ListView - cipv6.de","isPartOf":{"@id":"https:\/\/www.cipv6.de\/worp\/#website"},"datePublished":"2018-01-04T15:27:59+00:00","breadcrumb":{"@id":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.cipv6.de\/worp\/index.php\/2018\/01\/04\/android-log-or-toast-the-selected-item-in-an-listview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cipv6.de\/worp\/"},{"@type":"ListItem","position":2,"name":"Android: Log or Toast the selected Item in an ListView"}]},{"@type":"WebSite","@id":"https:\/\/www.cipv6.de\/worp\/#website","url":"https:\/\/www.cipv6.de\/worp\/","name":"cipv6.de","description":"","publisher":{"@id":"https:\/\/www.cipv6.de\/worp\/#\/schema\/person\/5d62b275485540be9e5e9e33d4fab86d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cipv6.de\/worp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.cipv6.de\/worp\/#\/schema\/person\/5d62b275485540be9e5e9e33d4fab86d","name":"ugu5ma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g","caption":"ugu5ma"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/7211dd31d32612293e4228c8f880721a803dcc15211868f096ea9a8e77b6f316?s=96&d=mm&r=g"},"sameAs":["https:\/\/cipv6.de"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9uBTs-23","jetpack-related-posts":[{"id":46,"url":"https:\/\/www.cipv6.de\/worp\/index.php\/2017\/12\/22\/android-listview-clicked-item-loschen\/","url_meta":{"origin":127,"position":0},"title":"Android Listview: clicked item l\u00f6schen","author":"ugu5ma","date":"December 22, 2017","format":false,"excerpt":"[java] package de.clarisweb.android.listview; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final ListView myListView = findViewById((R.id.myListView)); final ArrayList myFamily = new ArrayList(); myFamily.add(\"P1\"); myFamily.add(\"P2\"); myFamily.add(\"P3\"); myFamily.add(\"P4\"); myFamily.add(\"P5\"); final ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, myFamily); myListView.setAdapter(arrayAdapter); myListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView adapterView,\u2026","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.cipv6.de\/worp\/index.php\/tag\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":51,"url":"https:\/\/www.cipv6.de\/worp\/index.php\/2017\/12\/22\/android-timer\/","url_meta":{"origin":127,"position":1},"title":"Android: Timer","author":"ugu5ma","date":"December 22, 2017","format":false,"excerpt":"[java] @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); new CountDownTimer(10000, 100) { public void onTick(long millisecondsUntilDone) { Log.i(\"Seconds Left!\", String.valueOf(millisecondsUntilDone \/ 1000)); Toast.makeText(MainActivity.this, \"\" + String.valueOf(millisecondsUntilDone \/ 1000), Toast.LENGTH_SHORT).show(); } public void onFinish() { Log.i(\"We're done!\", \"No more countdown\"); } }.start();<\/pre> [\/java]","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.cipv6.de\/worp\/index.php\/tag\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":42,"url":"https:\/\/www.cipv6.de\/worp\/index.php\/2017\/12\/22\/run-task-in-background\/","url_meta":{"origin":127,"position":2},"title":"Android: run task in background","author":"ugu5ma","date":"December 22, 2017","format":false,"excerpt":"\u00a0 [java] package de.clarisweb.android.downloadwebcontent; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; public class MainActivity extends AppCompatActivity { public class DownloadTask extends AsyncTask\u00a0{ @Override protected String doInBackground(String... strings) { Log.i(\"URL\", strings[0]); return \"done !\"; } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DownloadTask task = new DownloadTask(); String\u2026","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.cipv6.de\/worp\/index.php\/tag\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":58,"url":"https:\/\/www.cipv6.de\/worp\/index.php\/2017\/12\/22\/android-query-jso-data-log-the-response-to-logcat\/","url_meta":{"origin":127,"position":3},"title":"Android: Query JSON-Data , log the response to logcat","author":"ugu5ma","date":"December 22, 2017","format":false,"excerpt":"[java] package de.clarisweb.android.jsondemo; import android.os.AsyncTask; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.View; import android.view.Menu; import android.view.MenuItem; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class MainActivity extends AppCompatActivity { public class DownloadTask extends AsyncTask< String, Void, String> { @Override protected String doInBackground(String...\u2026","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.cipv6.de\/worp\/index.php\/tag\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":74,"url":"https:\/\/www.cipv6.de\/worp\/index.php\/2017\/12\/22\/android-get-specific-json-attribute\/","url_meta":{"origin":127,"position":4},"title":"Android: get specific JSON attribute","author":"ugu5ma","date":"December 22, 2017","format":false,"excerpt":"When accessing\u00a0http:\/\/headers.jsontest.com\/ the following content is provided: { \"X-Cloud-Trace-Context\": \"778d633b22354c11045ece44c646dd2a\/11146751159933655926\", \"Accept-Language\": \"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,sv;q=0.6,la;q=0.5\", \"Host\": \"headers.jsontest.com\", \"DNT\": \"1\", \"User-Agent\": \"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.84 Safari\/537.36\", \"Postman-Token\": \"5851966f-f18b-cb0f-ab9c-e39ca6878d76\", \"Accept\": \"*\/*\", \"Cache-Control\": \"no-cache\" } The Goal is to extract the values for\u00a0 Host and User-Agent. first of all\u2026","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.cipv6.de\/worp\/index.php\/tag\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":663,"url":"https:\/\/www.cipv6.de\/worp\/index.php\/2021\/05\/15\/java-remove-brackets-leading-slashes-from-string\/","url_meta":{"origin":127,"position":5},"title":"Java: Remove brackets \/ leading slashes from String","author":"ugu5ma","date":"May 15, 2021","format":false,"excerpt":"My Android-app have always presented the DNS-Server(s) with brackets \/ leading slashes like: How can we get rid of these unnecessary characters ? String myIp2Dns1: String myIp2Dns1 = String.valueOf (LinkProp.getDnsServers()) ; Log: Log.d(\"myDnsInfo - Domain - \", \"Domain = \" + LinkProp.getDomains()); D\/myDnsInfo: dns = [\/10.0.2.3] Solution: Manipulation of String\u2026","rel":"","context":"In \"Android\"","block_context":{"text":"Android","link":"https:\/\/www.cipv6.de\/worp\/index.php\/tag\/android\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.cipv6.de\/worp\/wp-content\/uploads\/2021\/05\/1-2.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":0,"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cipv6.de\/worp\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}