You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Include the ZoomView in an existing layout, for example as a FrameLayout
child.
2. Run the application.
3. Crash.
What is the expected output? What do you see instead?
I expect the ZoomView to be placed inside it's parent view. Exception thrown
instead:
java.lang.RuntimeException: Unable to start activity ComponentInfo
-> Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class pl.polidea.view.ZoomView
-> Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]
The problem is that ZoomView does not provide alternative constructors that
accept layout parameters. I fixed adding these two:
public ZoomView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public ZoomView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
Now it look to work well.
Original issue reported on code.google.com by [email protected] on 19 Feb 2013 at 9:14
The text was updated successfully, but these errors were encountered:
i followed ur suggestion and got rid of inflation exception. but now i am
getting null pointer exception at
View v1 =
((LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.la
yout.standalone_example, null, false);
v1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
zoomview.addView(v1);//here
my xml code is as follows
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/relat">
<com.example.image.ZoomView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<com.example.image.PageCurlView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/dcgpagecurlPageCurlView1"
>
</com.example.image.PageCurlView>
</com.example.image.ZoomView>
</LinearLayout>
Original issue reported on code.google.com by
[email protected]
on 19 Feb 2013 at 9:14The text was updated successfully, but these errors were encountered: