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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:15:33+00:00 2026-06-08T09:15:33+00:00

I have an application that when the user clicks a tablerow, it changes the

  • 0

I have an application that when the user clicks a tablerow, it changes the layout.
Here is the code

 <TableRow
                android:id="@+id/tableRow1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/cell_table"
                android:onClick="goAir" >

And the method for the onClick:

public void goAir(View view){
    setContentView(R.layout.va_air);
}

How do I add a transition between the layouts changing. Something like a slide.

Thanks

  • 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-08T09:15:34+00:00Added an answer on June 8, 2026 at 9:15 am

    There are multiple ways of doing this. I prefer using Fragment.

    /**
     * Adding given Fragment into content area without transition.
     * This is good for initializing view.
     * @param f
     */
    private void addContentView(Fragment f){
        FragmentTransaction ft =getSupportFragmentManager().beginTransaction();
        ft.add(R.id.contentPane, f).commit();
    }
    
    /**
     * Replacing Fragment in content area with given Fragment
     * @param f Fragment to display
     * @param tag String of the content area
     * @param animIn Resource ID for new screen transition.
     * @param animOut Resource ID for old screen transition.
     */
    private void replaceContentView(Fragment f, String tag, int animIn, int animOut){
        // -1 is passed when I want to use default animation.
        if(animIn == -1) animIn = R.anim.fragment_slide_left_enter;
        if(animOut == -1) animOut = R.anim.fragment_slide_left_exit;
        FragmentTransaction ft =getSupportFragmentManager().beginTransaction();
        ft.setCustomAnimations(animIn, animOut); // Animate new view in and existing view out
    
        ft.replace(R.id.contentPane, f, tag); // id of the FrameLayout to put the Fragment in
        ft.commit();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup application that if user clicks the same setup twice, they
The set-up: I have an android application that so far can register a user
I'm new to Android development. I have an application that allows the user to
I have created an application that runs in the taskbar. When a user clicks
I have an application that allows the user to take a picture with the
I have an application that allows the user to download a csv. This works
I have an application that allows the user to edit multiple text fields and
So I have an application that allows a user to pick one of three
We have a PHP/MYSQL application that collects user input, including special characters like ø,ü,ñ,
I have made an application that gives the user the option to open up

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.