There's an error when i run it : "android.view.viewinflate$InflateException:Binary XML file line #15: Error inflating class MyImageView"
Here's the code :
Using java Syntax Highlighting
- public class MyImageView extends ImageView{
- public MyImageView(Context context,AttributeSet attr, Map inflateParams)
- {
- super(context,attr,inflateParams);
- }
- public MyImageView(Context context)
- {
- super(context);
- }
- @Override
- protected void onDraw(Canvas arg0) {
- // TODO Auto-generated method stub
- super.onDraw(arg0);
- }
- @Override
- public boolean onMotionEvent(MotionEvent event) {
- int action = event.getAction();
- boolean mCurDown = action == MotionEvent.ACTION_DOWN;
- boolean mCurUp = action == MotionEvent.ACTION_UP;
- if (mCurDown) {
- this.setImageDrawable(getResources().getDrawable(R.drawable.down));
- } else
- if (mCurUp) {
- this.setImageDrawable(getResources().getDrawable(R.drawable.up));
- }
- return true;
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="UTF-8"?>
- <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="300px" android:layout_height="300px"
- android:padding="0px" android:background="@drawable/bg">
- <TableRow>
- <TextView android:text="PlayerColor"
- android:layout_width="100px" />
- <Button id="@+id/button" android:text="aasdasd"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- </TableRow>
- <TableRow>
- <MyImageView
- id="@+id/imgv"
- android:layout_width="183px"
- android:layout_height="67px"
- android:src="@drawable/up"
- />
- </TableRow>
- </TableLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
Where's the problem ?
Thank you


