Radio button error
saadkhurshidmalik opened this issue · comments
i have no radio button in my layout file but error comes as "
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RadioButton.setOnClickListener(android.view.View$OnClickListener)' on a null object reference"
please help me out, i really need this library
Hi @saadkhurshidmalik , I figured out.
You have to do this:
<com.wordplat.ikvstockchart.InteractiveKLineLayout
android:id="@+id/main_chart"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RadioGroup
android:id="@+id/But_Group"
android:layout_width="match_parent"
android:layout_height="@dimen/stock_index_tab_height"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:layout_marginBottom="90dp"
android:orientation="horizontal"
>
<RadioButton
android:id="@+id/MACD_But"
style="@style/StockIndexTabStyle"
android:layout_height="match_parent"
android:text="MACD"
/>
<RadioButton
android:id="@+id/RSI_But"
style="@style/StockIndexTabStyle"
android:layout_height="match_parent"
android:text="RSI"
/>
<RadioButton
android:id="@+id/KDJ_But"
style="@style/StockIndexTabStyle"
android:layout_height="match_parent"
android:text="KDJ"
/>
<RadioButton
android:id="@+id/BOLL_But"
style="@style/StockIndexTabStyle"
android:layout_height="match_parent"
android:text="BOLL"
/>
</RadioGroup>
</com.wordplat.ikvstockchart.InteractiveKLineLayout>
Bye