Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7759937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:45:10+00:00 2026-06-01T13:45:10+00:00

i am trying one example from Here for ontouch image zoom and touch on

  • 0

i am trying one example from Here for ontouch image zoom and touch on other section of mobile screen zoom-out so simply i have find this link and try to implement in code but there are something error like

04-06 10:58:53.618: ERROR/AndroidRuntime(493): FATAL EXCEPTION: main
04-06 10:58:53.618: ERROR/AndroidRuntime(493): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Zoom_imageview/com.Zoom_imageview.Zoom_imageviewActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class com.sonyericsson.zoom.ImageZoomView
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.os.Looper.loop(Looper.java:123)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.ActivityThread.main(ActivityThread.java:4627)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at java.lang.reflect.Method.invokeNative(Native Method)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at java.lang.reflect.Method.invoke(Method.java:521)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at dalvik.system.NativeStart.main(Native Method)
04-06 10:58:53.618: ERROR/AndroidRuntime(493): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.sonyericsson.zoom.ImageZoomView
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.Activity.setContentView(Activity.java:1647)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at com.Zoom_imageview.Zoom_imageviewActivity.onCreate(Zoom_imageviewActivity.java:38)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-06 10:58:53.618: ERROR/AndroidRuntime(493):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

Code :

package com.Zoom_imageview;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.Zoom_imageview.zoom.ImageZoomView;
import com.Zoom_imageview.zoom.SimpleZoomListener;
import com.Zoom_imageview.zoom.ZoomState;
import com.Zoom_imageview.zoom.SimpleZoomListener.ControlType;

public class Zoom_imageviewActivity extends Activity {
    /** Called when the activity is first created. */
    private static final int MENU_ID_ZOOM = 0;

    /** Constant used as menu item id for setting pan control type */
    private static final int MENU_ID_PAN = 1;

    /** Constant used as menu item id for resetting zoom state */
    private static final int MENU_ID_RESET = 2;

    /** Image zoom view */
    private ImageZoomView mZoomView;

    /** Zoom state */
    private ZoomState mZoomState;

    /** Decoded bitmap image */
    private Bitmap mBitmap;
    private SimpleZoomListener mZoomListener;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try
        {
        mZoomState = new ZoomState();

        mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);

        mZoomListener = new SimpleZoomListener();
        mZoomListener.setZoomState(mZoomState);

        mZoomView = (ImageZoomView)findViewById(R.id.zoomview);
        mZoomView.setZoomState(mZoomState);
        mZoomView.setImage(mBitmap);
        mZoomView.setOnTouchListener(mZoomListener);

        resetZoomState();
        }catch (Exception e) {
            // TODO: handle exception
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        mBitmap.recycle();
        mZoomView.setOnTouchListener(null);
        mZoomState.deleteObservers();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add(Menu.NONE, MENU_ID_ZOOM, 0, R.string.menu_zoom);
        menu.add(Menu.NONE, MENU_ID_PAN, 1, R.string.menu_pan);
        menu.add(Menu.NONE, MENU_ID_RESET, 2, R.string.menu_reset);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case MENU_ID_ZOOM:
                mZoomListener.setControlType(ControlType.ZOOM);
                break;

            case MENU_ID_PAN:
                mZoomListener.setControlType(ControlType.PAN);
                break;

            case MENU_ID_RESET:
                resetZoomState();
                break;
        }

        return super.onOptionsItemSelected(item);
    }

    /**
     * Reset zoom state and notify observers
     */
    private void resetZoomState() {
        mZoomState.setPanX(0.5f);
        mZoomState.setPanY(0.5f);
        mZoomState.setZoom(1f);
        mZoomState.notifyObservers();
    }




}

XML ::

<?xml version="1.0" encoding="utf-8"?>
<com.sonyericsson.zoom.ImageZoomView
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/zoomview"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    />

Please help me out…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:45:11+00:00Added an answer on June 1, 2026 at 1:45 pm
    <?xml version="1.0" encoding="utf-8"?>
    <com.sonyericsson.zoom.ImageZoomView
        xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@+id/zoomview"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        />
    

    change it to

     <?xml version="1.0" encoding="utf-8"?>
        <com.Zoom_imageview.zoom.ImageZoomView
            xmlns:android="http://schemas.android.com/apk/res/android" 
            android:id="@+id/zoomview"
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent" 
            />
    

    or if u have not added a class ImageZoomView in your project then plz add it as in example Here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile the example from the official guide , the one with
Situation: I'm trying run an https store (xcart) under one domain secure.example.com and I
I am trying a very simple Fluent Nhibernate example: SQL 2005 database with one
I am trying to produce some example graphics using ggplot2, and one of the
I'm trying to update one value of a compound primary key from within the
I am trying to open one window from another using makeKeyAndOrderFront. The new window
I'm trying to make work the example from hibernate reference. I've got simple table
I'm new to pgf so i was trying out some examples from the pgfplot
Here's example from Steve Sanderson's blog demonstrating a containerless IF statement in knockout: <h3>Products</h3>
I'm using the photo slider code from here: http://tympanus.net/codrops/2010/10/07/slider-gallery/ and trying to modify it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.