Android AppWidget: Error inflating Class
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;com.org.BatteryManager.BatteryView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/&gt; 

package com.org.BatteryManager;

import java.util.Map;

import android.view.View;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.os.BatteryManager;


public class BatteryView extends View{

    public BatteryView(Context context){
        super(context);
        init();
    }

    public BatteryView(Context context, AttributeSet attrs){
        super(context,attrs);
        init();
    }

    public BatteryView(Context context, AttributeSet attrs, int defaultStyles){
        super(context, attrs, defaultStyles);
        init();
    }
    public void init(){
    }

    protected void onMeasure(int widthSpec, int heightSpec){
        int measuredWidth = MeasureSpec.getSize(widthSpec);
        int measuredHeight = MeasureSpec.getSize(heightSpec);

        setMeasuredDimension( measuredWidth, measuredHeight);
    }

    @Override

    protected void onDraw(Canvas canvas){
        Paint mTextPaint =new Paint();
        mTextPaint.setColor(Color.GREEN);
        mTextPaint.setTextSize(40);
        int height = getMeasuredHeight();
        int width = getMeasuredWidth();
        String displayText = "Widget";
        float textWidth = mTextPaint.measureText(displayText);
        int px= width/2;
        int py=height/2;
        canvas.drawText(displayText, px-textWidth/2, py, mTextPaint);
        invalidate();
    }
}
</code></pre>

<p>My constructors are perfect but I am not sure about that xml.</p>
