首页 > 移动平台 > 详细

java.lang.NoSuchMethodException: <init> [class android.content.Context, interface androidutil.Attri

时间:2015-07-22 18:54:59      阅读:445      评论:0      收藏:0      [点我收藏+]
<pre name="code" class="java"><span style="font-size:24px;">private int mIndex;
public HomeItem(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub

		mContext = context;
		TypedArray attrs_index = context.obtainStyledAttributes(attrs,
				R.styleable.attrs_index);//实现该属性
		mIndex = attrs_index.getInteger(R.styleable.attrs_index_index, 0);
		//此处执行初始化操作
	}</span>




</pre><pre name="code" class="java"><pre name="code" class="java"><span style="font-size:24px;">attrs.xml
<?xml version="1.0" encoding="utf-8"?>  
<resources>  
    <declare-styleable name="attrs_index">  
        <attr name="index" format="integer" />  
    </declare-styleable>  
</resources></span>





java.lang.NoSuchMethodException: <init> [class android.content.Context, interface androidutil.Attri

原文:http://blog.csdn.net/woyaochenggong774/article/details/47005643

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!