class not found : com.android.graphics.CanvasView

PressRex profile image
by PressRex
class not found : com.android.graphics.CanvasView

I use this library in my project but i get an error:

class 'com.android.graphics.CanvasView' not found

How i can fix it?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">


<com.android.graphics.CanvasView
    android:id="@+id/canvas"
    android:layout_width="match_parent"
    android:layout_height="600dp"
    android:layout_gravity="center_horizontal" />

</LinearLayout>

in java code :

package com.example.falah.paint2;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;



public class DrawActivity extends AppCompatActivity {

private CanvasView canvas;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_draw);

    canvas = (CanvasView)this.findViewById(R.id.canvas);
}
}

Source: View source

PressRex profile image
by PressRex

Subscribe to New Posts

Lorem ultrices malesuada sapien amet pulvinar quis. Feugiat etiam ullamcorper pharetra vitae nibh enim vel.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More