Swiping Between Activities?

Oct 30, 2013

The application is kind of a book. The first screen is an opening screen (ImageView), and clicking on it will lead to the table of contents.

The table of contents, as any of the other chapters is a separate activity. It has a LinearLayout that contains a Header (TextView) and a chapters list (ListView).

The chapters themselves also built the same, so each item in the list is a different paragraph.

Clicking an item on the chapters list (in the table of contents) will switch to the activity with the relevant chapter.

Swiping from left to right on a certain chapter (including the table of contents) will switch to the next chapter.

Swipe left will lead to the previous one. Note that there is no mistake here: Text direction is RTL.

At first, the swiping only worked when the swiping was performed on an empty areas of the screen, and not on the contents of the ListView. So in order for the swipe to work on the items as well, I have performed the following (after consulting some guides in the web):

1. I have added a GestureDetector member to the activity.

2. I have initialized the above member with a private class overriding GestureDetector.SimpleOnGestureListener and implementing onFling. It is a straight forward implementation: Just calculating the direction of the swipe and determining the next chapter.
3. Clicking an Item: I have added the current activity to the ListView by setOnItemClickListener. This activity implements onItemClick by switching to the correct chapter.

4. Swiping: I have added to the ListView, by setOnTouchListener, an interface which implements onTouch by calling the GestureDetector member.

The problem is that this doesn't work as expected:

a. Scrolling the list doesn't work well: I have assumed that like any other application, swiping the finger will start a fast scroll that will slow down until stopped. Instead the scrolling is fixed according to the finger movement: As long as the finger moves, the list is scrolled and the scroll is stopped the moment the finger is raised from the screen.

b. Looks like overriding both setOnItemClickListener and setOnTouchListener causes trouble. If I swipe right on one of the chapters in the list in the table of contents (say chapter 7), I will get to the first chapter as expected, but clicking the back button, will return me to the table of contents activity and the same chapter 7 item will be highlighted.

Swiping between activities?


HTC EVO 4G :: Live Wallpaper Lag While Swiping Screens

Jul 22, 2010

I downloaded and installed all of the galaxy live wallpapers through the xda developers forums and they look amazing but they all cause a huge amount of lag especially when swiping through screens. Any thoughts as to why this might be happening and if so any solutions?

View 11 Replies View Related

HTC Incredible :: Get Rid Of Swiping Unlock Screen?

Apr 30, 2010

Has anyone been able to disable the screen in which you have to swipe down to unlock the phone? I'd like to use just the unlock pattern option like on the Moto Droid, but I haven't been able to get rid of the swiping screen altogether.

View 26 Replies View Related

General :: Status Bar Swiping From Top Of Screen?

Jun 8, 2013

Is there anyway to have the status bar always hidden BUT you can swipe from the top of the screen to show the status bar..then disappear after some time

View 1 Replies View Related

General :: Swiping From One Desktop (homescreen) To Another?

Feb 1, 2013

I am looking for one setting or utility in Android systems generally, I will try to explain problem: I have one 7" tablet (Emgeton Consul 3 with 4.0.4 ICS) and Phone (Samsung Galaxy Young) with Jellyblast 3.0.4 rom?/mod? (claims about itself it is android 4.1.1).

I have three desktops (homescreens?) on phone. Moving finger left get me to desktop number 2 (right of 1), if i do it again, i am at the third desktop and from the third by swiping finger i will get to first. This is beaviour i dont want to. I want to go 1 >> 2 >> 3 >> and stop. And ofcourse back 3>> 2 >> 1 and stop. This is how is my tablet working, and I want to "tell" phone to behave the same. Have you experiences with some setting / utility / system modification that can do it ?

View 3 Replies View Related

Android :: Switching Activities / Passing Data Between Activities

Jun 30, 2010

how to call BarCodeScanner, and return the value to a field.so now, i have a toast that says "successful scan" and then i want to pass the result to a new activity. when i comment out my intent, everything works (minus the passing of data/switching of screen, obviously) but when i run my project as is, it FC's no errors reported by eclipse in code or xml. any insights?

View 2 Replies View Related

HTC Hero :: Any Application Where Only Widgets Move While Swiping Screens?

Dec 8, 2009

I am just wondering if there is like a app where the widgets just move rather than both the widgets and background move when you are swiping from screen to screen

View 1 Replies View Related

Android :: Code To Unlock Phone Instead Of Swiping Finger Method?

Aug 7, 2010

Is there an app which needs a code to unlock the phone instead of the swiping finger method?

View 3 Replies View Related

Motorola Droid X :: Touch Screen Lagging - Unresponsive When Swiping

Jul 16, 2010

I got my Droid X yesterday and for the most part I'm impressed. (I didn't realize how much I liked HTC's Sense UI until replaced my Incredible with this phone.)

So far my only frustration is the touch screen. When I'm swiping between home screens, or even in applications, it often doesn't register anything or it'll open the first icon I touch even though I'm swiping. Sometimes I have to press an icon a couple times before it'll open up as well. This is getting REALLY frustrating because I can't just do things quickly but I have to watch to see if what I selected actual opens or swipes, etc.

I've only installed a few applications, including LauncherPro. Is anybody else having any issues like this?

View 4 Replies View Related

HTC Droid Eris :: Touchscreen Acting Schizophrenic And Swiping To Left / Fix It

Jan 12, 2010

Hopefully someone has had this problem. My phone has just recently started to have this problem. When I am at the home screen, my phone will begin to swipe to the left by itself even when my finger is nowhere near the screen. When tilting the phone or aggravating the accelerometer, it begins to do it more. Also, some of the icons are selected green by itself (but not actually selecting the icon if that makes sense).

Argh, I really don't want to hard reset (not even sure if that'll fix it).

View 4 Replies View Related

General :: Galaxy Note 2 - Installing Apps After Swiping Memories

Feb 1, 2013

I have used many mods that swips internal memory by the external memory and vise versa..

So everything worked perfectly but installing apps no longer work.. When I install an app it says app not installed..

BUT installing apps through Play Store works perfectly as it should..

My device: Galaxy Note 2 running CyanogenMod 10.1 nightlies ..

View 2 Replies View Related

HTC Incredible :: Swiping Down Notification Bar / Back It Up - Hit Back Button?

May 5, 2010

Instead of trying to grab the notification bar and swiping it down, simply start ABOVE the screen and swipe down. Fast or slow makes no difference.

You can swipe it back up, or simply hit the back button.

View 15 Replies View Related

Recognize Vertical Swiping And Vertical Scrolling In Gridview

Apr 14, 2014

I have a Gridview, include hundred of items (thumbnail images). I set a multi-select mode, in this mode, user just need to swipe his finger to start selecting multiple items (this case, gridview can not be scrolled). And in a normal touch, Gridview still can vertically scroll for user to see other thumbnails and continue selecting.

View 2 Replies View Related

KitKat 4.4 :: Change Between Tabs By Swiping Left To Right To Change Tabs

Jan 10, 2014

i have a problem with this new kitkat os. Before kitkat i could change between tabs by swiping left to right ir right to left to change tabs.Now it doesn't change.

View 1 Replies View Related

Android :: When To Use More Activities?

Nov 14, 2010

I have an Activity which is an OpenGL view. I also have an xml layout to use for preferences. Until now, to show the preference menu, I just brought it to front by setContentView(). And the same to get back to the OpenGL view. But is this a case where I should give the preference menu its own Activity? I guess this would make a few things much easier. For example, the back button would just work, opposed to now where I have to code it or it will just exits the application.And if this is a good idea, how do I pass data both ways? I have a class that store all preferences. Can I send it to the Activity and back again? Or is the best way to store the preferences in a sqlite database and then use it for passing data?

View 2 Replies View Related

Android :: How To Communicate Between 2 Activities?

Apr 22, 2009

I have read 'http://developer.android.com/guide/tutorials/notepad/notepad-ex2.html', specifically step 4 ahow can I return a different result to the 'calling activity', in this example, it always return ACTIVITY_CREATE. What if the 'activity being launcher' has a 'okay' and a 'cancel' button. How can the 'calling activity' knows which button user presses in the 'activity being launcher'.

View 3 Replies View Related

Android :: Way To Swap Activities?

Aug 15, 2010

Right now I have 2 activities (A+B) and what I would like is for only 1 of them ever to be on the stack (If A shows B, I want the back button from B to go to the home screen not A). Is their a good way of doing this with activities Or should I change my app to be a bunch of views?

View 5 Replies View Related

Android :: How Can I Get All Name Of Activities In System ?

Apr 15, 2010

In my project ,I need get all the name of the activities ,not only my own application, but also the third party application , and how can I get?

View 3 Replies View Related

Android :: Launching Activities Within Tab

Aug 20, 2009

I have an application with three tabs. Through various interactions with the items in the tabs I end up launching other activities. The client has reviewed this and would like the activities launched "within" the tabs, so the tabs remain visible and if the user clicks the tab it goes back to the original activity defined in the setContent function. Is this possible and how would I go about this from other activities? (ie the child activities, not the one that defines the TabHost and has access to call setContent)?

View 4 Replies View Related

Android :: App With Multiple Activities

Feb 8, 2010

I have a very simple game that consists of only one activity, and I want to add a title screen.If the title screen is another activity, what changes do I need to make to my manifest file to make the title screen open first?The gameplay activity is called Leeder, and the title screen activity is called LeederTitleScreen.

View 1 Replies View Related

Android :: ProgressBar Between To Activities?

Apr 3, 2010

when click the grid item, i want to show a progressbar between the time of next Activity shown. then the second activity has a custom listview. there also i want to show a progressbar. how to do that?

View 1 Replies View Related

Android :: Activities UI Persistence

Jun 10, 2010

I need to have two activities in an Android app that can be switched between each other with UI persistence.I would like the changes made in step 2 to be visible in step 4.I have tried using the singleInstance activity tag on Activity B to no avail. I would also prefer a more elegant solution than simply writing all object properties to a file or SQLite table.It seems that this behaviour must be easily achievable given that Android does it automatically for calls to onBackPressed() where the parent Activity's UI is saved.

View 2 Replies View Related

Android :: TabHost Activities Within Each Tab

Jun 23, 2010

I'm trying to create multiple tabs, each with a different Activity. The only downside is i'm using a custom layout file thus my class extends an Activity rather than a TabActivity. While trying to run, it fails and suggests calling TabHost.Setup(ActivityGroupManager agm)

View 3 Replies View Related

Android :: Activities Vs Views

Jul 8, 2010

I am working on an Android app that has multiple screens the user will need to navigate between and I am curious what the best practices are when switching between those screens. I am torn between creating a new Activity for each screen and simply changing the view (setContentView(R.layout.whatever)). The screens all share at least some variable values so I'm leaning toward changing views and using class level variables, but I'm worried a single activity could become very large and confusing with logic for multiple screens in a single file. I'd like to keep the code clean and separated, but I also don't want to be passing several variables around between views if that isn't needed.Being new to Android development, I'm hoping some more experienced members of the community could share their thoughts and let me know how best to handle it

View 2 Replies View Related

Android :: How To Manage Activities?

Jul 24, 2010

i identified problem in changing one activity using tab, in on tab activity i am adding data to sqlite in other tab activity i am displaying them using listview(array adapter)but when i come back to add data and after adding new item to sqlite the newly added records are not updated in listview.

View 3 Replies View Related

Android :: Data Between Activities

Jun 30, 2009

Is it possible to transfer data between activities without using "extars"? I need to access MyOwnObject in Atctivity 1 from Activity2 Possible with using static fields?

View 6 Replies View Related

Android :: How To Get Icons Of Activities

Oct 27, 2010

I am trying to display a list of all activities (i.e., icon and label) on the phone in a ListView. Here is my code to get the activities:

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

However, when I display the list, many of the activities' icons weren't found. I tried both of the following to get the icons to no avail:

resolve.activityInfo.getIconResource() resolve.activityInfo.icon

What's the proper way to do this?

View 3 Replies View Related

Android :: How To Set Same XML Attributes To All Activities ?

Dec 7, 2009

In my application, I don't want the activity to restart when user changes his mobile's orientation or when he opens his physical keyboard.So, I have to assign the following XML attribute to all my activities in the manifest file.Is it possible to assign the same XML attribute value to all activities ? Or should I copy the attribute in all the <activity> tags of the manifest?

View 3 Replies View Related

Android :: Some Activities Never Display UIs?

Feb 2, 2009

I hear that "some Activities never display UIs" according to http://code.google.com/android/devel/building-blocks.html. My question: is this true? I have yet to find a way to make an Activity without a UI. Documentation suggests an Activity can be non-visual.For example, Activity.getWindow() returns the "current window, or null if the activity is not visual."When would an Activity have a null Window?

View 2 Replies View Related

Android :: Activities With Different Orientations

Apr 7, 2009

Let's assume i got two activities "Main" and "Sub" Activity "Main" is forced into portrait orientation using setRequestedOrientation At some later point "Main" runs "Sub" using startActivityForResult.Somehow "Sub" also starts in portrait orientation while i would expect the call to setRequestedOrientation only to affect the calling activity.How do i get "Sub" to respect the system orientation while keeping "Main" locked in Portrait?

View 8 Replies View Related







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