Open Aduci01 opened 7 years ago
Well, you have a BarChart and you are working with a linechart in your Java Code. Also the android:id
is not matching.
If you are you defining it in the xml file there is no need to create a new instance in code you just need to set the data.
I get this error: Unable to start activity ComponentInfo{com.example.adam.polocoach/com.example.adam.polocoach.Graphicons}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.github.mikephil.charting.charts.BarChart.setData(com.github.mikephil.charting.data.ChartData)' on a null object reference -> My linechart is a null object but i can't figure out why...
My xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.adam.polocoach.Graphicons" android:id="@+id/rl">
My activity: LineChart lineChart;
I've tried to add lineChart manually too. Pls help