I get this strange error in logcat, and I tried everything that occurred to me to solve this problem and still get it. Here is logcat:
11-08 12:30:26.184: E/AndroidRuntime(4396): FATAL EXCEPTION: main 11-08 12:30:26.184: E/AndroidRuntime(4396): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dm.test/com.dm.test.ui.BitCanvasActivity}: android.view.InflateException: Binary XML file line
and this is my xml:
<?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android" xmlns:bitdraw="http://schemas.android.com/apk/res/com.dm.test" > <view class="com.dm.test.ui.BitCanvasActivity$CanvasView" android:id="@+id/backgroundz" android:layout_width="match_parent" android:layout_height="match_parent" /> <com.dm.test.widget.ActionButtons android:id="@+id/btn_actions" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginBottom="135dp" android:layout_gravity="bottom|center_horizontal" /> <com.dm.test.widget.ColorPicker android:id="@+id/color_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|center_horizontal" android:orientation="horizontal" bitdraw:colors="@array/color_picker_colors" bitdraw:cols="3" bitdraw:fils="5" /> </merge>
and on the line .java 55 is:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate( savedInstanceState ); setContentView( R.layout.bit_canvas );
and this is part of the inner class:
public class CanvasView extends View { public CanvasView(Context c) { super(c); } public CanvasView(Context context, AttributeSet attrs) { super(context, attrs); } public CanvasView (Context c, AttributeSet atr, int defstyle){ super(c, atr,defstyle); } @Override protected void onDraw(Canvas canvas) { ... }
Any help would be greatly appreciated because I actually ran out of ideas: S
source share