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 W3Make Forum 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 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.

Sign InSign Up

Forum By W3make

Forum By W3make Logo Forum By W3make Logo

Forum By W3make Navigation

  • Home
  • About Us
  • Blog
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Questions Feed
  • Blog
  • Contact Us
Home/ Questions/Q 14949
Next
In Process
Abhishek
  • 0
AbhishekBegginer
Asked: June 26, 20232023-06-26T11:14:34+05:30 2023-06-26T11:14:34+05:30In: Android Development

Animation

  • 0

How to give animations in android studio, and that should be time oriented and works well every time whenever that screen is opened.

android
  • 1 1 Answer
  • 22 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Kaushik Rana Begginer
    2023-06-26T11:46:10+05:30Added an answer on June 26, 2023 at 11:46 am

    This is also called splash screen.

    Here an example of how you can implement a splash screen in Android:

    1. Create a new layout file for your splash screen. For instance, you can create a file named `activity_splash.xml` in your `res/layout` directory. Customize the layout according to your design requirements.

    “`xml
    <!– activity_splash.xml –>
    <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
    android:layout_width=”match_parent”
    android:layout_height=”match_parent”
    android:orientation=”vertical”
    android:gravity=”center”
    android:background=”@color/splash_background”>

    <!– Add your splash screen content here –>
    <ImageView
    android:layout_width=”wrap_content”
    android:layout_height=”wrap_content”
    android:src=”@drawable/splash_logo”
    android:contentDescription=”@string/splash_logo_description” />

    <TextView
    android:layout_width=”wrap_content”
    android:layout_height=”wrap_content”
    android:text=”@string/app_name”
    android:textColor=”@color/white”
    android:textSize=”24sp”
    android:paddingTop=”16dp” />

    </LinearLayout>
    “`

    2. Create a new activity class for the splash screen. For example, you can create a file named `SplashActivity.java`. In this activity, set the desired layout using `setContentView()` in the `onCreate()` method and apply any additional logic or customization.

    “`java
    public class SplashActivity extends AppCompatActivity {

    private static final long SPLASH_DELAY = 2000; // 2 seconds

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    // Delay for a specific time and then launch the main activity
    new Handler().postDelayed(new Runnable() {
    @Override
    public void run() {
    Intent intent = new Intent(SplashActivity.this, MainActivity.class);
    startActivity(intent);
    finish();
    }
    }, SPLASH_DELAY);
    }
    }
    “`

    In the above code, we set the content view to the `activity_splash.xml` layout. Then, using a `Handler` and `postDelayed()`, we create a delay of 2 seconds (you can adjust this value as needed) before starting the `MainActivity`.

    3. Declare the SplashActivity in your AndroidManifest.xml file by adding the following code within the `<application>` element:

    “`xml
    <activity
    android:name=”.SplashActivity”
    android:theme=”@style/Theme.Splash”
    android:exported=”true”>
    <intent-filter>
    <action android:name=”android.intent.action.MAIN” />
    <category android:name=”android.intent.category.LAUNCHER” />
    </intent-filter>
    </activity>
    “`

    Ensure that the `android:name` attribute points to the correct package name and class name for your SplashActivity.

    4. Optionally, you can define a custom theme for your splash screen in your `styles.xml` file:

    “`xml
    <style name=”Theme.Splash” parent=”Theme.AppCompat.NoActionBar”>
    <item name=”android:windowBackground”>@drawable/splash_background</item>
    </style>
    “`

    In this example, we set a custom window background for the splash screen using the `splash_background` drawable resource.

    Remember to replace `@color/splash_background`, `@drawable/splash_logo`, and `@string/app_name` with your own color, drawable, and string resources, respectively.

    With these steps, you can implemented a basic splash screen in your Android application. The splash screen will be displayed for the specified duration and then transition to your main activity (`MainActivity` in this example).

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

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 3k
  • Answers 2k
  • Best Answers 34
  • Users 5k
  • Popular
  • Answers
  • Mohammed aleem hasan

    What programming language is used for Android development?

    • 65 Answers
  • Manichandana

    Is this mandatory to write css code in making a ...

    • 58 Answers
  • vishakha_1713

    How to decide whether to use DELETE statement or DROP ...

    • 46 Answers
  • Jova0731
    Jova0731 added an answer Before I logged in I checked out Big Ass Sex… October 8, 2025 at 11:41 am
  • Jova0731
    Jova0731 added an answer If you're new to buying a custom sex doll, you… July 31, 2025 at 8:41 am
  • Jova0731
    Jova0731 added an answer Some of us with dark hearts want to design other… July 5, 2025 at 1:56 pm

Related Questions

  • LushKite

    How to Make Ganganzelli Trulala in Steal A Brainrot

    • 0 Answers
  • jean8

    u4gm Diablo 4 Season 10 Rogue Build for Efficient Farming

    • 0 Answers
  • Anonymous

    The Art of Escalation: How to Survive and Thrive in ...

    • 0 Answers

Top Members

saningh

saningh

  • 5 Questions
  • 116 Points
Pundit
Vishnu M

Vishnu M

  • 2 Questions
  • 96 Points
Teacher
akshatt25

akshatt25

  • 12 Questions
  • 68 Points
Teacher

Trending Tags

#css #html #questions 3d printing ai android android development android studio answer api app development c++ coding data Database developer development error flutter hacking help ios java javascript kotlin machine learning ml performance php plugin plugins poll programming python question security seo social media sql technology theme web web development website WordPress word press wordpress development wordpressdevelopment wordpress error wordpress errors

Explore

  • Recent Questions
  • Most Answered
  • Answers
  • Most Visited
  • Most Voted
  • No Answers
  • Feed
  • Favorites Questions

Footer

W3make forum is a social questions & Answers platform which will help you establis your community and connect with other people.

Legal Stuff

  • Privacy Policy
  • Terms and Conditions

Help

  • Questions Feed
  • Blog
  • Contact Us

Follow

© 2023 W3make.com | All Rights Reserved.

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.