Android :: OnTouch Not Called?

Aug 4, 2010

I'm trying to start activity by sweeping across the screen, it works fine for all the other screens, just this screen that doesn't fire the onTouch at all? Would you mind helping me? I've tried debugging it and still have no idea at all. Below are the codes, sorry for not putting snippets only as I thought I might did something wrong elsewhere

I'm also looking for advice on implementing sweeping to change screen. I've read about ViewFlipper and I know it will work very well, but I've around 8 screens with different backend coding needed.

CODE:.....................

Android :: onTouch not called?


Android :: Paint & OnTouch

Oct 25, 2009

I have a problem with one of my app. I try to make a paint application but nothing is draw on the screen (except the first circle which is draw on the launch).The log Cat seems to be correct and i get the right x/y coordinates.I think i do something wrong on the ondraw.do you see my problem?

View 3 Replies View Related

Android :: Detect OnTouch For Widget?

Oct 2, 2009

I'm trying to make widget gallery at homescreen. I'm currently stuck because didn't find any example how to detect on touch in widget. Could someone help me?

View 5 Replies View Related

Android :: OnTouch Not Working Properly / HTC Magic

Dec 2, 2009

I'm trying to develop a touch control, but I'm getting some problems with the onTouch method. Basically, only the event ACTION_DOWN is working. The others seems to be in trouble.My application has a LinearLayout, containing a VideoView.I have a HTC Magic updated to 1.6.

View 3 Replies View Related

Android :: How To Set Up Button Presses With OnTouch Event?

Mar 27, 2010

I am relatively new to this still, and I have been developing a small app that would benefit greatly from a user being able to press 2 buttons at one time. What is the best method for achieving this? I dont think that an OnClickListener works like that, and I have seen examples for doing this with an OnTouch event. However, I do not know how to set up button presses with an OnTouch event.

View 3 Replies View Related

Android :: Can't Intercept The OnTouch Event Of PopupWindow

May 26, 2009

I want to intercept the OnTouch event in a PopupWindow, but it failes everytime. Here is the code snip:

CODE:.....................

When the activity started, I can click the button to show the popup window correctly. But after that, nothing happens when I touch the popup window's view. But if I touch any where outside the popup window, the log Log.d("Demo", "layout::onTouch >>> view: " + v + ", event: " + event); will work.

It looks like when I touch the view of the popup window, the touch event has been consumed somewhere?

View 2 Replies View Related

Android :: Possible To Implement Both Ontouch And Also Onfling In Same Listview?

Nov 15, 2010

I have a listview and implemented onclick and also onfling.problem is when i do fling(swipe left to right), onclick event of listview is also getting executed.How to overCome this problem? how to differentiate touch(tap) and fling(swipe) in listview? code...

P.S: is it possible? to comment the onclicklistener of listview and writing the same logic in any onTouchEvent? but still i doubt onfling will call ontouch. right?

View 1 Replies View Related

Android :: OnTouch Event Sometimes Not Firing ACTION_POINTER_DOWN

Jul 9, 2010

I'm trying to implement pinch-zoom in an app I'm making and am having issues with the onTouch event. It appears that the pointer up & down actions do not fire immediately, like you won't get a pointer up or down until an action move occurs. So what happens if both fingers hit the screen nearly simultaneously is that the 2nd finger (should be pointer(1)) gets a move action before pointer down is called, making the code think it's a DRAG not a pinch zoom.

View 2 Replies View Related

Android :: Implement Multiple Views That React To OnTouch?

Oct 10, 2010

Let's say I have MyActivity and inside my onCreate method I initialize MyBackgroundView, then MyPlayer1View then MyPlayer2View. I want to be able to touch the screen, figure out if I have touched Player1 or Player2 and then respond with changes to the players if I have touched them.

My problem is, where do I put the onTouchListener? Can only MyBackgroundView listen for touches, or can the players listen for touches too? If MyBackgroundView can only accept touches, do I need to call view.ontouchlistener that says, you have touched me, and I have a player at those coordinates, so I'll pass the motion event to the player and let it handle it? Or do call view.ontouchlistener in each of the players that says, you've touched me, now I will react to the motion event?

View 1 Replies View Related

Android :: Context Menu Long Press And OnTouch Event Conflicting

Oct 26, 2010

I have a situation where I have some textview on a framelayout that I have a onTouch event wired in order to simulate dragging. I alos want to enable the ability to have a context menu display when the user long presses the textview. Now that I have implemented the context menu functionality dragging no longer works since the longpress is always served by the context menu event.Does anyone know of a workaround for this.

View 2 Replies View Related

Android :: Android 1.5 - Asynctask DoInBackground Not Called / Method Called

Oct 26, 2010

I am running into an issue with the way my asynctasks are executed. Here's the problem code:

firstTask = new background().new FirstTask(context);
if(firstTask.execute().get().toString().equals("1"))
secondTask = new background().new SecondTask(context);

What I'm doing here is creating a new asynctask object, assigning it to firstTask and then executing it. I then want to fire off a separate asynctask when the first one is done and making sure it returns a success value (1 in this case). This works perfectly on Android 2.0 and up. However, I am testing with Android 1.5 and problems start popping up. The code above will run the first asynctask but doInBackground() is never called despite onPreExecute() being called. If I am to execute the first task without the get() method, doInBackground() is called and everything works as expected. Except now I do not have a way to determine if the first task completed successfully so that I can tell the second task to execute. Is it safe to assume that this is a bug with asynctask on Android 1.5? Especially since the API says that the get method has been implemented since API 3. Is there any way to fix this? Or another way to determine that the first task has finished?

View 2 Replies View Related

Android :: How To Called Mp3 Download?

Jun 4, 2010

I was reading through app suggestions and someone mentioned an app called mp3 Download that basically functions like limewire, letting you search and download mp3's to your phone. Does anyone know anything about this app and whether it is good or not? Or have suggestions for a similiar app? It had mixed reviews at appbrain and when I searched here it came up with a bunch of other threads.

View 4 Replies View Related

Android :: An App Called Listen?

Sep 22, 2010

I was told by a few friends that the iphone has an app that allows you to hold your phone up to a song that you dont know and it tells you the name.Does android have anything like that?

View 6 Replies View Related

Android :: OnKeyDown Not Always Called In App

Oct 20, 2009

I've created a simple android game, based on the Lunar Lander sample, and I'm having a problem with handling key events.When the activity starts, the only keys that onKeyDown or onKeyUp get called for are the dpad up/down/left/right keys.Neither the menu, back, or dpad_center keys trigger onKey methods. However, once I've pushed one of the dpad up/down/left/right buttons, pressing the menu, back, or dpad_center keys do trigger these methods. I'm not getting any errors, or any indication of what's going wrong.It's possible that the focus is set wrong - the activity is started from a button on screen, so it could be in touchscreen mode. If that's the case, shouldn't touching the back button get me in to the right focus mode so that I can catch the event?I'm using the emulator from SDK-1.5r3.I have not been able to try this on a real phone yet.

View 4 Replies View Related

Android :: Whats That App Called?

Aug 27, 2010

I saw it on the market but forgot to install it. It displays the number of remaining minutes, texts and data left for the month if your on a monthly mobile phone plan.

View 2 Replies View Related

Android :: OnLowMemory Not Getting Called

Apr 6, 2010

I'm working on an application which allocates lot of memory and hence I'm bound to get OutOfMemory. I want a way to get notified when system is running short of memory so that I can stop processing further, notify user and release as much memory as possible.

According to official Android documentation there is a callback onLowMemory from the system. I have a class which extends android.app.Application and I have overridden onLowMemory() method. This class has entry in the in the application tag of AndroidManifest. However it never gets called in my case. Do I need to register for this event using AndroidManifest or any other means?

View 9 Replies View Related

Android :: OnContextMenuClosed() Not Called Under 2.x

Jan 1, 2010

In one of my applications I programmatically open the context menu when something is clicked in my MapActivity overlay. This works perfectly under 1.x as well as on my 2.0 Milestone. I've used showContextMenuForChild() historically, but openContextMenu() does that same thing.

As expected onCreateContextMenu() is called to build the menu and then onContextItemSelected() is called when something is selected. So far all is well.

The odd thing is that under 1.x the onContextMenuClosed() method is called when I press the back key, but not so under 2.0. This confuses states for my app since I need to know whether menu is shown or not - or maybe there is a way to know this that I have not (yet) figured out...

Is this a deliberate change or should I file it as a bug? Googling comes up pretty dry (stuff that is over a year old).

Anyone with a 2.0.1 Droid that would care to test whether this has already been fixed? (The ETA for Milestone 2.0.1 seems hazy still, but it appears that at least one of my reported bugs has been fixed in 2.0.1 event though it isn't flagged as such.)

View 4 Replies View Related

Android :: OnSurfaceCreated Called Twice

Oct 27, 2010

Is there a way to make sure onSurfaceCreated is called only once during startup.

Currently in my app it gets called once with say 800x480 then it gets called a second time with 480x800. I guess this is probably due to a call to setRequestedOrientation in onCreate. Is there any way to make sure the app starts in a particular orientation, to prevent orientation changes, and to have onSurfaceCreated get called only once during start up?

View 3 Replies View Related

Android :: When Does OnFocusChanged Get Called

Mar 3, 2009

I have over-loaded the onFocusChanged() in my classes which inherits from LinearLayout.

CODE:...........................

View 4 Replies View Related

Android :: UncaughtExceptionHandler Not Called?

Apr 16, 2010

i use a ScheduledThreadPoolExecutor combined with a ThreadFactory, their all combined should cause an unchaught Exception to be logged so that i can see what happening if any thread is dying in the ThreadPool:

threadPool = new ScheduledThreadPoolExecutor(poolSize, new ThreadFactory());

My ThreadFactory, also sets a UncaughtExceptionHandler :

public Thread newThread(final Runnable r) { final Thread thread = new Thread(r); thread.setUncaughtExceptionHandler(new ThreadLogger()); final int counter = count.getAndIncrement(); final String name = threadName + counter; thread.setName(threadName + counter); if (Logging.isLoggingEnabled()) { Log.d(LOG_TAG, "Thread created :" + name); } return thread; }

The ThreadLogger :................

View 2 Replies View Related

Android :: OnLocationChanged Does Not Get Called?

Mar 7, 2009

I have been struggling to get onLocationChanged called, but I'm not sure it does not. Here're my code

criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setPowerRequirement(Criteria.POWER_LOW); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setSpeedRequired(false); criteria.setCostAllowed(true);

String locationContext = Context.LOCATION_SERVICE; locationManager = (LocationManager)context.getSystemService (locationContext);

String provider = locationManager.getBestProvider(criteria, true);.................

View 2 Replies View Related

Android :: OnSaveInstanceState() Normally Not Called?

Jul 5, 2009

Am I right to assume that onSaveInstanceState() is not normally called (which my logging indicates) - but only when the system is forced to kill an Activity. If so, since onPause() does not receive a bundle, what is the best way to save state that should be restored the next time the Activity is created?

View 8 Replies View Related

Android :: 1.6 - OnActivityResult Is Not Called

Jul 6, 2010

I have a problem with the method "onActivityResult".

I create a new Activity from my main activity:

CODE:.........

The new Activity is ended like this:

CODE:.............

But the Method onActivityResult seem to be not called

CODE:................

View 1 Replies View Related

Android :: Why OnKeyListener() Not Called

Sep 12, 2010

I defined an EditText-field and I want to be informed when the user edits that fields.
So I thought: simple - I add an OnKeyListener and so I did. But even though the text field gets edited (and even displays the entered/modified text) I don't get any callback, i.e. the LOG-output doesn't show up.

CODE:......

why that callback is never called?

Android is really full of oddities! It seems that almost nothing I touched so far worked immediatly as one would expect. And - believe it or not - I have LOTS of experience with GUIs, esp. in Java (AWT, Swing, SWT, you name it...) But Android is a really tough beast!

View 2 Replies View Related

Android :: How Can GetContentResolver() Be Called

Sep 20, 2010

I want to know the context in which getContentResolver() is called ?

I have a scenario like this : I have an activity A that calls a method myFunc() of class B whcih is not an activity. So, in class B I have to use getContentResolver(). I directly called getContentResolver(). It was showing error. Then I called myFunc(Acitivy act) from the activity and called act.getContentResolver() which solved my problem. My question is is this the only way to call getContentResolver(), which means it can be used in context with activity or can be used alone.

View 1 Replies View Related

Android :: Mouse OnListItemClick() Is Not Being Called

Jan 11, 2010

i've tried displaying a simple list in ListActivity, it is working fine but the problem i got is with the listener.. when i click on any of the list item using the mouse onListItemClick() is not being called, strangely it is working fine with the key-up&key-down keys...................

View 2 Replies View Related

Android :: Why OnListItemClick() Not Getting Called Back

Jul 16, 2010

I have a ListActivty and I overload the onListItemClick(ListView listView, View view, int position, long id) in my List Activity. My question is why onListItemClick() not getting called back (i have breakpoint in my debugger) when I have an ImageButton in my list item view (the one view created by my list adaptor from cursor)?

View 1 Replies View Related

Android :: How Do I Know If Activity.onStop Is Being Called?

Dec 3, 2009

I need be able to tell if Activity.onStop() was called because my application is moving to a new activity, or if it was closed because the user pressed the "Home" key or hit the back button from the bottom of the activity stack.The reason is because I need to know when it is appropriate to shut off music that is playing in my application (A game). There is nothing more annoying than hitting home and having something playing music in the background.However, Activity.OnStop() is called for each activity change, and I don't want to suspend music when moving between multiple activities in my app. I just can't find a way to differentiate between going home and going to a internal activity.Am I perhaps hooking into the wrong events?

View 3 Replies View Related

Android :: OnKeyDown Not Being Called In TabActivity

Jun 20, 2010

I am trying to override the behavior of a TabActivity that has other Activities as children. I have made all of the children activities return false in onKeyDown so that the key will propagate through to the parent.However, this is not the case.The only key that is being recognized is the search key.Back, menu, and home are not being overridden.

View 6 Replies View Related

Android :: Method Called After Release

Sep 22, 2010

I'm getting this error ( in the end of this post) which I guess I understand it's because I'm calling something after releasing it.. but I can't find a wy to work it around.I've tried all combinations.. I've tried: mCamera.setPreviewCallback(null); This class, where the surfaceview is implemented can be accessed by 2 different classes one that doesnt implement surfaceview and other that does the error just shows me when I go from the activity that uses the camera to the activity that also uses camera.I don't know what else to do.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved