• Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
Sunday, March 15, 2026
No Result
View All Result
Subscribe Now
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    Headless victim in 1976 New York cold case identified through DNA: police

    Headless victim in 1976 New York cold case identified through DNA: police

    What’s Good? – The New York Times

    What’s Good? – The New York Times

    Israel’s Deadly Blockade Traps 7 U.S. Doctors in Gaza

    Israel’s Deadly Blockade Traps 7 U.S. Doctors in Gaza

    Carney announces billions for defense and infrastructure in Canada’s North

    Carney announces billions for defense and infrastructure in Canada’s North

    Right-wing media’s Mamdani outrage fuels GOP anti-Muslim rhetoric

    Right-wing media’s Mamdani outrage fuels GOP anti-Muslim rhetoric

    12-year-old girl dies days after collapsing following fight near school bus stop

    12-year-old girl dies days after collapsing following fight near school bus stop

    Speaker Mike Johnson Sketches ‘Course Correction’ in DHS Deportation Policy

    Speaker Mike Johnson Sketches ‘Course Correction’ in DHS Deportation Policy

    Where Was ‘War Machine’ Filmed? Discover the ‘War Machine’ 2026 Filming Locations for Alan Ritchson’s Netflix Movie

    Where Was ‘War Machine’ Filmed? Discover the ‘War Machine’ 2026 Filming Locations for Alan Ritchson’s Netflix Movie

    L.A. City Council candidate stays in race after report that he stabbed a boy at age 12

    L.A. City Council candidate stays in race after report that he stabbed a boy at age 12

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
The Insight Post
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    Headless victim in 1976 New York cold case identified through DNA: police

    Headless victim in 1976 New York cold case identified through DNA: police

    What’s Good? – The New York Times

    What’s Good? – The New York Times

    Israel’s Deadly Blockade Traps 7 U.S. Doctors in Gaza

    Israel’s Deadly Blockade Traps 7 U.S. Doctors in Gaza

    Carney announces billions for defense and infrastructure in Canada’s North

    Carney announces billions for defense and infrastructure in Canada’s North

    Right-wing media’s Mamdani outrage fuels GOP anti-Muslim rhetoric

    Right-wing media’s Mamdani outrage fuels GOP anti-Muslim rhetoric

    12-year-old girl dies days after collapsing following fight near school bus stop

    12-year-old girl dies days after collapsing following fight near school bus stop

    Speaker Mike Johnson Sketches ‘Course Correction’ in DHS Deportation Policy

    Speaker Mike Johnson Sketches ‘Course Correction’ in DHS Deportation Policy

    Where Was ‘War Machine’ Filmed? Discover the ‘War Machine’ 2026 Filming Locations for Alan Ritchson’s Netflix Movie

    Where Was ‘War Machine’ Filmed? Discover the ‘War Machine’ 2026 Filming Locations for Alan Ritchson’s Netflix Movie

    L.A. City Council candidate stays in race after report that he stabbed a boy at age 12

    L.A. City Council candidate stays in race after report that he stabbed a boy at age 12

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
No Result
View All Result
No Result
View All Result
Home Mobile

Prepare your app to support predictive back gestures

by Theinsightpost
August 1, 2022
in Mobile
0 0
0
Prepare your app to support predictive back gestures



Posted by Jason Tang, Product Management, Diego Zuluaga, Developer Relations, and Michael Mauzy, Developer Documentation

Since we introduced gesture navigation in Android 10, users have signaled they want to understand where a back gesture will take them before they complete it.

As the first step to addressing this need, we’ve been developing a predictive back gesture. When a user starts their gesture by swiping back, we’ll show an animated preview of the destination UI, and the user can complete the gesture to navigate to that UI if they want – as shown in the following example.

Although the predictive back gesture won’t be visible to users in Android 13, we’re making an early version of the UI available as a developer option for testing starting in Beta 4. We plan to make the UI available to users in a future Android release, and we’d like all apps to be ready. We’re also working with partners to ensure it’s consistent across devices.

Read on for details on how to try out the new gesture and support it in your apps. Adding support for predictive back gesture is straightforward for most apps, and you can get started today.

We also encourage you to submit your feedback.

Try out the predictive back gesture in Beta 4

To try out the early version of the predictive back gesture available through the developer option, you’ll need to first update your app to support the predictive back gesture, and then enable the developer option.

Update your app to support predictive back gesture

To help make predictive back gesture helpful and consistent for users, we’re moving to an ahead-of-time model for back event handling by adding new APIs and deprecating existing APIs.

The new platform APIs and updates to AndroidX Activity 1.6+ are designed to make your transition from unsupported APIs (KeyEvent#KEYCODE_BACK and OnBackPressed) to the predictive back gesture as smooth as possible.

The new platform APIs include OnBackInvokedCallback and OnBackInvokedDispatcher, which AndroidX Activity 1.6+ supports through the existing OnBackPressedCallback and OnBackPressedDispatcher APIs.

You can start testing this feature in two to four steps, depending on your existing implementation.

To begin testing this feature:

1. Upgrade to AndroidX Activity 1.6.0-alpha05. By upgrading your dependency on AndroidX Activity, APIs that are already using the OnBackPressedDispatcher APIs such as Fragments and the Navigation Component will seamlessly work when you opt-in for the predictive back gesture. 

// In your build.gradle file:
dependencies {

  // Add this in addition to your other dependencies
  implementation “androidx.activity:activity:1.6.0-alpha05”

2. Opt-in for the predictive back gesture. Opt-in your app by setting the EnableOnBackInvokedCallback flag to true at the application level in the AndroidManifest.xml.

<application

    …

    android:enableOnBackInvokedCallback=”true”

    … >

…

</application>

If your app doesn’t intercept the back event, you’re done at this step.

Note: Opt-in is optional in Android 13, and it will be ignored after this version.

3. Create a callback to intercept the system Back button/event. If possible, we recommend using the AndroidX APIs as shown below. For non-AndroidX use cases, check the platform API mentioned above.

This snippet implements handleOnBackPressed and adds the OnBackPressedCallback to the OnBackPressedDispatcher at the activity level.

 val onBackPressedCallback = object: OnBackPressedCallback(true) {

   override fun handleOnBackPressed() {

     // Your business logic to handle the back pressed event

   }

 }

 requireActivity().onBackPressedDispatcher

   .addCallback(onBackPressedCallback)

4. When your app is ready to stop intercepting the system Back event, disable the onBackPressedCallback callback.

 

onBackPressedCallback.isEnabled = webView.canGoBack()

Note: Your app may require using the platform APIs (OnBackInvokedCallback and OnBackPressedDispatcher) to implement the predictive back gesture. Read our documentation for details.

Enable the developer option to test the predictive back gesture

Once you’ve updated your app to support the predictive back gesture, you can enable a developer option (supported in Android 13 Beta 4 and higher) to see it for yourself.

To test this animation, complete the following steps:

  1. On your device, go to Settings > System > Developer options.
  2. Select Predictive back animations.
  3. Launch your updated app, and use the back gesture to see it in action.

Thank you again for all the feedback and being a part of the Android Community – we love collaborating together to provide the best experience for our users.



Source link

ShareTweetSend
Previous Post

Review: ‘M. Butterfly’ Metamorphoses Again, as an Opera

Next Post

why a criminal justice approach is necessary to protect our oceans – europeantimes.news

Related News

ROI of AI in Manufacturing: Costs, Speed & Accuracy
Mobile

ROI of AI in Manufacturing: Costs, Speed & Accuracy

March 14, 2026
Avocado Health introduces AI-Powered text coaching for parents
Mobile

Avocado Health introduces AI-Powered text coaching for parents

March 13, 2026
India AI Impact Summit 2026: The Global South Takes Centre Stage in Shaping the Future of AI — Mobile App Development | Design
Mobile

India AI Impact Summit 2026: The Global South Takes Centre Stage in Shaping the Future of AI — Mobile App Development | Design

March 12, 2026
Mobile AppSec in CI/CD: Implementation Guide for DevSecOps
Mobile

Mobile AppSec in CI/CD: Implementation Guide for DevSecOps

March 11, 2026
Next Post
why a criminal justice approach is necessary to protect our oceans – europeantimes.news

why a criminal justice approach is necessary to protect our oceans – europeantimes.news

Discussion about this post

Subscribe To Our Newsletters

    Customer Support


    1251 Wilcrest Drive
    Houston, Texas
    77042 USA
    Call-832.795.1420
    e-mail – news@theinsightpost.com

    Subscribe To Our Newsletters

      Categories

      • Africa
      • Africa-East
      • African Sports
      • American Sports
      • Arts
      • Asia
      • Australia
      • Business
      • Business Asia
      • Business- Africa
      • Canada
      • Defense
      • Education
      • Egypt
      • Energy
      • Entertainment
      • Europe
      • European Soccer
      • Finance
      • Germany
      • Ghana
      • Health
      • Insight
      • International
      • Investing
      • Japan
      • Latest Headlines
      • Life & Living
      • Markets
      • Mobile
      • Movies
      • New Zealand
      • Nigeria
      • Politics
      • Scholarships
      • Science
      • South Africa
      • South America
      • Sports
      • Tech
      • Travel
      • Travel-Africa
      • UK
      • USA
      • Weather
      • World
      No Result
      View All Result

      Recent News

      Ancient Dogs Started Diversifying 11,000 Years Ago, Long Before the Modern Breeds We Know Today

      Ancient Dogs Started Diversifying 11,000 Years Ago, Long Before the Modern Breeds We Know Today

      March 15, 2026
      Another 3 members of Iran’s women’s soccer team decide against staying in Australia as refugees

      Another 3 members of Iran’s women’s soccer team decide against staying in Australia as refugees

      March 15, 2026
      Crown Prince Reza Pahlavi ready to lead Iran transition government

      Crown Prince Reza Pahlavi ready to lead Iran transition government

      March 15, 2026
      Larkey’s Kangaroos shut off Power for convincing win

      Larkey’s Kangaroos shut off Power for convincing win

      March 15, 2026
      • Home
      • Advertise With Us
      • About Us
      • Corporate
      • Consumer Rewards
      • Forum
      • Privacy Policy
      • Social Trends

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      Welcome Back!

      Login to your account below

      Forgotten Password?

      Retrieve your password

      Please enter your username or email address to reset your password.

      Log In

      Add New Playlist

      We are using cookies to give you the best experience on our website.

      You can find out more about which cookies we are using or switch them off in .

      No Result
      View All Result
      • Home
      • Insight
      • Blog
      • Business
      • Entertainment
      • Health
      • Politics
      • Shop
        • Gift Shop
        • Value Shop
        • Store
        • Bargain Shop
        • Discount
      • Sports
      • Tech
      • Travel
      • USA
      • Video
      • World
        • Asia
        • Africa
        • South America
        • North America
        • Europe
        • Oceania

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      The Insight Post
      Powered by  GDPR Cookie Compliance
      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      Cookie Policy

      More information about our Cookie Policy