<?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: Jerald Jacob</title>
    <description>The latest articles on DEV Community by Jerald Jacob (@jeraldjacob).</description>
    <link>https://dev.to/jeraldjacob</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F200643%2Fcde4e6ed-4efb-42ba-be9a-52abde26c030.jpeg</url>
      <title>DEV Community: Jerald Jacob</title>
      <link>https://dev.to/jeraldjacob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeraldjacob"/>
    <language>en</language>
    <item>
      <title>How can I access a Non-static method In a library </title>
      <dc:creator>Jerald Jacob</dc:creator>
      <pubDate>Fri, 02 Apr 2021 20:11:47 +0000</pubDate>
      <link>https://dev.to/jeraldjacob/how-can-i-access-a-non-static-method-in-a-library-1fjc</link>
      <guid>https://dev.to/jeraldjacob/how-can-i-access-a-non-static-method-in-a-library-1fjc</guid>
      <description>&lt;p&gt;Hi, I'm new to android. Now I have used a library to implement ripple effect into my application.&lt;br&gt;
This is the scenario.&lt;br&gt;
1) I'm using the button image and its background ripple effect through an API from the server-side, and I'm keeping the response at the time of application login, into &lt;strong&gt;SharedPreferences&lt;/strong&gt;.&lt;br&gt;
2) I'm using the &lt;strong&gt;BroadcastReceiver&lt;/strong&gt; to implement the button effect.&lt;br&gt;
3) The button is represented as an image and its background ripple effect.&lt;br&gt;
(The library I used for this implementation is &lt;a href="https://github.com/skyfishjy/android-ripple-background"&gt;https://github.com/skyfishjy/android-ripple-background&lt;/a&gt;)&lt;br&gt;
4) The library provides the ripple color in the form of &lt;strong&gt;TypedArray&lt;/strong&gt;&lt;br&gt;
(hear is the code section of the implementation)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleBackground);
    rippleColor=typedArray.getColor(R.styleable.RippleBackground_rb_color, getResources().getColor(R.color.rippleColor));
    rippleStrokeWidth=typedArray.getDimension(R.styleable.RippleBackground_rb_strokeWidth, getResources().getDimension(R.dimen.rippleStrokeWidth));
    rippleRadius=typedArray.getDimension(R.styleable.RippleBackground_rb_radius,getResources().getDimension(R.dimen.rippleRadius));
    rippleDurationTime=typedArray.getInt(R.styleable.RippleBackground_rb_duration,DEFAULT_DURATION_TIME);
    rippleAmount=typedArray.getInt(R.styleable.RippleBackground_rb_rippleAmount,DEFAULT_RIPPLE_COUNT);
    rippleScale=typedArray.getFloat(R.styleable.RippleBackground_rb_scale,DEFAULT_SCALE);
    rippleType=typedArray.getInt(R.styleable.RippleBackground_rb_type,DEFAULT_FILL_TYPE);
    typedArray.recycle();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;in this code &lt;strong&gt;rippleColor=typedArray.getColor(R.styleable.RippleBackground_rb_color, getResources().getColor(R.color.rippleColor));&lt;/strong&gt;&lt;br&gt;
That is my problem part.&lt;/p&gt;

&lt;p&gt;Already I mention that I'm using the &lt;strong&gt;SharedPreferences&lt;/strong&gt; to keep the response.&lt;br&gt;
how can I parse the response through the library and get the ripple color which I provide through my response?&lt;/p&gt;

&lt;p&gt;hear is my code&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; rippleColor=typedArray.getColor(R.styleable.RippleBackground_rb_color,Color.parseColor(BroadcastReceiverClass.getRadarColor()));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;my &lt;strong&gt;BroadcastReceiverClass&lt;/strong&gt; is not a static class (Because it receives the auth response through the Intent).&lt;/p&gt;

&lt;p&gt;Now I'm trying to access &lt;strong&gt;Non-static method 'getRadarColor()' cannot be referenced from a static context&lt;/strong&gt;. How can I fix this problem?&lt;br&gt;
I can't create an instance of the class at that library (Because it BroadcastReceiverClass ** extends FrameLayout*&lt;em&gt;) and the contractor has different parameters Like **Context context, AttributeSet attrs, int defStyle&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;If anyone knows about this problem please share your suggestions.&lt;br&gt;
Moreover, I think it's not a big thing but unfortunately, it consumes me more than a day.&lt;/p&gt;

</description>
      <category>android</category>
      <category>java</category>
      <category>sdk</category>
    </item>
  </channel>
</rss>
