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 7880637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:11:26+00:00 2026-06-03T04:11:26+00:00

My app was running fine, albiet with no functionality, but since I added support

  • 0

My app was running fine, albiet with no functionality, but since I added support for gestures (code adapted from a tutorial) it now just crashes on running.

package com.mystraldesign.memorable;

import android.app.Activity;
//import android.gesture.GestureOverlayView;
import android.gesture.GestureOverlayView;
import android.gesture.GestureOverlayView.OnGestureListener;
import android.graphics.Typeface;
import android.os.Bundle;
//import android.widget.RelativeLayout;
import android.view.GestureDetector;
import android.view.GestureDetector.OnDoubleTapListener;
import android.view.MotionEvent;
import android.view.Window;
import android.widget.TextView;

public class MemorableActivity extends Activity implements OnGestureListener,OnDoubleTapListener 
{
    //Define text views
    private TextView textView1;
    private TextView textView2;
    private TextView textView3;
    private TextView textView4;

    //Gesture Detectors
    private GestureDetector gTap; 

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);

        gTap  = new GestureDetector(this,(android.view.GestureDetector.OnGestureListener) this);

        //Remove title bar
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);




        //Define textView
        textView1 = (TextView) findViewById(R.id.textView1);
        textView2 = (TextView) findViewById(R.id.textView2);
        textView3 = (TextView) findViewById(R.id.textView3);
        textView4 = (TextView) findViewById(R.id.textView4);

        //Load font file
        Typeface type = Typeface.createFromAsset(getAssets(),"fonts/optima.ttf"); 

        //Set various textViews to font
        textView1.setTypeface(type);
        textView2.setTypeface(type);
        textView3.setTypeface(type);
        textView4.setTypeface(type);


    }



    public boolean onTouchEvent(MotionEvent me){ 
      this.gTap.onTouchEvent(me);
     return super.onTouchEvent(me); 
    }

    public boolean onDown(MotionEvent e) {
      textView1.setText("Down");  
      return false;
    }

    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
      float velocityY) {
        textView1.setText("Fling");
      return false;
    }


    public void onLongPress(MotionEvent e) {
        textView1.setText("Long Press"); 
    }


    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
      float distanceY) {
        textView1.setText("Scroll");
     return false;
    }


    public void onShowPress(MotionEvent e) {
        textView1.setText("Show Press");
    }

    public boolean onSingleTapUp(MotionEvent e) {
        textView1.setText("Sing Tap Up");
     return false;
    }

    public boolean onDoubleTap(MotionEvent e) {
        textView1.setText("Double Tap");
     return false;
    }

    public boolean onDoubleTapEvent(MotionEvent e) {
        textView1.setText("Double Tap Event");
      return false;
    }

    public boolean onSingleTapConfirmed(MotionEvent e) {
        textView1.setText("Single Tap Confirmed");
     return false;
    }




}

I removed a @override statment from the start of each of the methods as Eclipse was stating an Error with them and gave the auto-fix to be remove the @override statements.

It also gave an error on the public class MemorableActivity extends Activity implements OnGestureListener,OnDoubleTapListener line which is:

Multiple markers at this line
    - The type MemorableActivity must implement the inherited abstract method 
     GestureOverlayView.OnGestureListener.onGestureEnded(GestureOverlayView, MotionEvent)
    - The type MemorableActivity must implement the inherited abstract method 
     GestureOverlayView.OnGestureListener.onGestureCancelled(GestureOverlayView, MotionEvent)
    - The type MemorableActivity must implement the inherited abstract method 
     GestureOverlayView.OnGestureListener.onGestureStarted(GestureOverlayView, MotionEvent)
    - The type MemorableActivity must implement the inherited abstract method 
     GestureOverlayView.OnGestureListener.onGesture(GestureOverlayView, MotionEvent)

It suggested the fixes of

Add unimplemented methods
Make MemorableActivity abstract
Rename in file
Rename in workspace

I tried the first two but it still crashes and I’m not sure what the second and third one are/do.

The doesn’t seem to be anything in the log but here is the output from console

[2012-04-30 03:54:37 - Memorable] ------------------------------
[2012-04-30 03:54:37 - Memorable] Android Launch!
[2012-04-30 03:54:37 - Memorable] adb is running normally.
[2012-04-30 03:54:38 - Memorable] Performing com.mystraldesign.memorable.MemorableActivity activity launch
[2012-04-30 03:54:38 - Memorable] Automatic Target Mode: launching new emulator with compatible AVD 'Memorable'
[2012-04-30 03:54:38 - Memorable] Launching a new emulator with Virtual Device 'Memorable'
[2012-04-30 03:54:44 - Emulator] 2012-04-30 03:54:44.155 emulator-arm[2796:1107] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
[2012-04-30 03:54:44 - Memorable] New emulator found: emulator-5554
[2012-04-30 03:54:44 - Memorable] Waiting for HOME ('android.process.acore') to be launched...
[2012-04-30 03:55:36 - Memorable] HOME is up on device 'emulator-5554'
[2012-04-30 03:55:36 - Memorable] Uploading Memorable.apk onto device 'emulator-5554'
[2012-04-30 03:55:41 - Memorable] Installing Memorable.apk...
[2012-04-30 03:55:57 - Memorable] Success!
[2012-04-30 03:55:57 - Memorable] Starting activity com.mystraldesign.memorable.MemorableActivity on device emulator-5554
[2012-04-30 03:56:00 - Memorable] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mystraldesign.memorable/.MemorableActivity }

EDIT:

Added log from Eclipse

04-30 05:43:25.339: D/AndroidRuntime(333): Shutting down VM
04-30 05:43:25.339: W/dalvikvm(333): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-30 05:43:25.369: E/AndroidRuntime(333): FATAL EXCEPTION: main
04-30 05:43:25.369: E/AndroidRuntime(333): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mystraldesign.memorable/com.mystraldesign.memorable.MemorableActivity}: java.lang.ClassCastException: com.mystraldesign.memorable.MemorableActivity
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.os.Looper.loop(Looper.java:123)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.ActivityThread.main(ActivityThread.java:3683)
04-30 05:43:25.369: E/AndroidRuntime(333):  at java.lang.reflect.Method.invokeNative(Native Method)
04-30 05:43:25.369: E/AndroidRuntime(333):  at java.lang.reflect.Method.invoke(Method.java:507)
04-30 05:43:25.369: E/AndroidRuntime(333):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-30 05:43:25.369: E/AndroidRuntime(333):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-30 05:43:25.369: E/AndroidRuntime(333):  at dalvik.system.NativeStart.main(Native Method)
04-30 05:43:25.369: E/AndroidRuntime(333): Caused by: java.lang.ClassCastException: com.mystraldesign.memorable.MemorableActivity
04-30 05:43:25.369: E/AndroidRuntime(333):  at com.mystraldesign.memorable.MemorableActivity.onCreate(MemorableActivity.java:33)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-30 05:43:25.369: E/AndroidRuntime(333):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-30 05:43:25.369: E/AndroidRuntime(333):  ... 11 more
  • 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-03T04:11:28+00:00Added an answer on June 3, 2026 at 4:11 am

    You are implementing one type of OnGestureListener but casting to another. Change your Activity class statement to this:

    public class MemorableActivity extends Activity implements android.view.GestureDetector.OnGestureListener,OnDoubleTapListener 
    

    and then implement the necessary methods and your crash should stop happening.

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

Sidebar

Related Questions

The Spotify iPhone app I was working on, was running fine, but now I
This app has been running fine for months, but now on iOS4 i get
I am installing inApp purchase in My app.Yesterday code was running fine and I
My app was building and running fine on the simulator and device, but I
My app is running fine in Simulator as well as device. Now I am
My application was running fine until i added the following code to add an
My iPhone app was running fine. I added a component to my xib file
i'm running my app are running fine until i resume from background or with
My App was running fine when I started it from inside Visual Studio with
I have a split view app running fine on the iPad. It is using

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.