<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pratik Butani</title>
    <description>The latest articles on DEV Community by Pratik Butani (@pratikbutani).</description>
    <link>https://dev.to/pratikbutani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F506403%2Fcea3da69-aaa9-4b6c-989b-4b20f5096424.jpeg</url>
      <title>DEV Community: Pratik Butani</title>
      <link>https://dev.to/pratikbutani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pratikbutani"/>
    <language>en</language>
    <item>
      <title>Answer: UnsupportedOperationException: Can't convert to dimension: type=0x1</title>
      <dc:creator>Pratik Butani</dc:creator>
      <pubDate>Sun, 21 Feb 2021 14:45:07 +0000</pubDate>
      <link>https://dev.to/pratikbutani/answer-unsupportedoperationexception-can-t-convert-to-dimension-type-0x1-7p7</link>
      <guid>https://dev.to/pratikbutani/answer-unsupportedoperationexception-can-t-convert-to-dimension-type-0x1-7p7</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/18741485/unsupportedoperationexception-cant-convert-to-dimension-type-0x1/18844713#18844713" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: UnsupportedOperationException: Can't convert to dimension: type=0x1
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Sep 17 '13&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/18741485/unsupportedoperationexception-cant-convert-to-dimension-type-0x1/18844713#18844713" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          187
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;After 2 days I found the solution; from the layout as defined in my question, I have a &lt;code&gt;Spinner&lt;/code&gt; which is bound with a custom &lt;code&gt;TextView&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/listTextViewSpinner"
    ...
    android:textSize="@dimen/spinner_list_item_text_size"
    ... /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here, I have an extracted dimension resource: &lt;code&gt;@dimen/spinner_list_item_text_size&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This has been defined…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/18741485/unsupportedoperationexception-cant-convert-to-dimension-type-0x1/18844713#18844713" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>android</category>
    </item>
    <item>
      <title>Answer: INSTALL_FAILED_DUPLICATE_PERMISSION… C2D_MESSAGE</title>
      <dc:creator>Pratik Butani</dc:creator>
      <pubDate>Sun, 21 Feb 2021 14:44:35 +0000</pubDate>
      <link>https://dev.to/pratikbutani/answer-installfailedduplicatepermission-c2dmessage-5bhe</link>
      <guid>https://dev.to/pratikbutani/answer-installfailedduplicatepermission-c2dmessage-5bhe</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/27043933/install-failed-duplicate-permission-c2d-message/27456355#27456355" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: INSTALL_FAILED_DUPLICATE_PERMISSION... C2D_MESSAGE
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Dec 13 '14&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/27043933/install-failed-duplicate-permission-c2d-message/27456355#27456355" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          232
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I've found a solution that works for me.&lt;/p&gt;
&lt;p&gt;In My Device (Nexus 7) Android 5.0. Lollipop I follow these steps.&lt;/p&gt;

&lt;p&gt;After Uninstalling App You will find &lt;code&gt;App Name&lt;/code&gt; under Apps List of the &lt;code&gt;Downloaded&lt;/code&gt; tab. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Settings &lt;/li&gt;
&lt;li&gt;Apps &lt;/li&gt;
&lt;li&gt;At the bottom of the list, you will find &lt;code&gt;YourApp&lt;/code&gt; with…&lt;/li&gt;
&lt;/ul&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/27043933/install-failed-duplicate-permission-c2d-message/27456355#27456355" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>android</category>
    </item>
    <item>
      <title>Answer: How to make EditText not focused when creating Activity</title>
      <dc:creator>Pratik Butani</dc:creator>
      <pubDate>Sun, 21 Feb 2021 14:44:13 +0000</pubDate>
      <link>https://dev.to/pratikbutani/answer-how-to-make-edittext-not-focused-when-creating-activity-5hd1</link>
      <guid>https://dev.to/pratikbutani/answer-how-to-make-edittext-not-focused-when-creating-activity-5hd1</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/18295802/how-to-make-edittext-not-focused-when-creating-activity/18295926#18295926" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: How to make EditText not focused when creating Activity
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Aug 18 '13&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/18295802/how-to-make-edittext-not-focused-when-creating-activity/18295926#18295926" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          301
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;You can set property of Layout like &lt;code&gt;android:descendantFocusability="beforeDescendants"&lt;/code&gt; and &lt;code&gt;android:focusableInTouchMode="true"&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;pre class="lang-xml prettyprint-override"&gt;&lt;code&gt;&amp;lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/mainLayout"
  android:descendantFocusability="beforeDescendants"
  android:focusableInTouchMode="true" &amp;gt;

    &amp;lt;EditText
        android:id="@+id/password"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/changePass"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="167dp"
        android:ems="10"
        android:imeOptions="flagNoExtractUi"
        android:inputType="textPassword"
        android:maxLength="30" &amp;gt;
    &amp;lt;/EditText&amp;gt;

&amp;lt;/RelativeLayout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;May this one helpful ;)&lt;/p&gt;

    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/18295802/how-to-make-edittext-not-focused-when-creating-activity/18295926#18295926" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>android</category>
      <category>edittext</category>
      <category>activity</category>
      <category>focus</category>
    </item>
    <item>
      <title>Answer: Bad state: Insecure HTTP is not allowed by platform:</title>
      <dc:creator>Pratik Butani</dc:creator>
      <pubDate>Fri, 12 Feb 2021 07:17:17 +0000</pubDate>
      <link>https://dev.to/pratikbutani/answer-bad-state-insecure-http-is-not-allowed-by-platform-fp2</link>
      <guid>https://dev.to/pratikbutani/answer-bad-state-insecure-http-is-not-allowed-by-platform-fp2</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/64197752/bad-state-insecure-http-is-not-allowed-by-platform/65578828#65578828" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: Bad state: Insecure HTTP is not allowed by platform:
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jan  5 '21&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/64197752/bad-state-insecure-http-is-not-allowed-by-platform/65578828#65578828" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          131
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;h2&gt;For Android:&lt;/h2&gt;
&lt;p&gt;This behavior may be omitted following migration guide: &lt;a href="https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android" rel="noreferrer"&gt;https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;or... Just add in &lt;strong&gt;&lt;code&gt;android/app/src/main/AndroidManifest.xml:&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;android:usesCleartextTraffic="true"&lt;/code&gt; to &lt;code&gt;&amp;lt;application /&amp;gt;&lt;/code&gt; also dont forget to take &lt;strong&gt;INTERNET&lt;/strong&gt; PERMISSION:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;uses-permission android:name="android.permission.INTERNET" /&amp;gt; &amp;lt;!-- This Line --&amp;amp;gt
&amp;lt;application
        android:name="io.flutter.app.FlutterApplication"
        android:label="receipt"
        android:usesCleartextTraffic="true" &amp;lt;!-- This Line --&amp;gt;
        android:icon="@mipmap/ic_launcher"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;For iOS:&lt;/h2&gt;
&lt;p&gt;Allow insecure/HTTP requests globally…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/64197752/bad-state-insecure-http-is-not-allowed-by-platform/65578828#65578828" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>network</category>
      <category>flutter</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Answer: Flutter how to handle Image.network error (like 404 or wrong url)</title>
      <dc:creator>Pratik Butani</dc:creator>
      <pubDate>Fri, 12 Feb 2021 07:16:04 +0000</pubDate>
      <link>https://dev.to/pratikbutani/answer-flutter-how-to-handle-image-network-error-like-404-or-wrong-url-dbe</link>
      <guid>https://dev.to/pratikbutani/answer-flutter-how-to-handle-image-network-error-like-404-or-wrong-url-dbe</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&gt;
          &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fstackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/52568872/flutter-how-to-handle-image-network-error-like-404-or-wrong-url/66167613#66167613" rel="noopener noreferrer"&gt;
            &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: Flutter how to handle Image.network error (like 404 or wrong url)
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Feb 12 '21&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/52568872/flutter-how-to-handle-image-network-error-like-404-or-wrong-url/66167613#66167613" rel="noopener noreferrer"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fstackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          16
        &lt;/div&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fstackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;You can display image from assets when you found 404 or any other error while loading image.&lt;/p&gt;
&lt;p&gt;What I have done is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  FadeInImage(
      image: NetworkImage("imageUrl"),
      placeholder: AssetImage(
          "assets/images/placeholder.jpg"),
      imageErrorBuilder:
          (context, error, stackTrace) {
        return Image.asset(
            'assets/images/error.jpg',
            fit: BoxFit.fitWidth);
      },
      fit: BoxFit.fitWidth,
    )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check &lt;code&gt;imageErrorBuilder&lt;/code&gt; property.&lt;/p&gt;

    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/52568872/flutter-how-to-handle-image-network-error-like-404-or-wrong-url/66167613#66167613" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>flutter</category>
      <category>android</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
