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

  • Home
  • SEARCH
  • 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 7005815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:23:56+00:00 2026-05-27T21:23:56+00:00

Will many import statements in a activity/apps affect performance in android. Example situation 1:

  • 0

Will many import statements in a activity/apps affect performance in android.

Example situation 1:

In a activity/public class (Let’s called it DialogHelper.java) , I handle all the apps dialog in this single DialogHelper.java and I have multiple import statements in that activity , will it effect the runtime performance or have any effect on the phone memory or slow down the performance?

Example situation 2:

Instead of using this catch (Exception e) which require no import at all

try {   
String url = "data";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
activity.startActivity(i);
  } catch (Exception e) {
    //Exception here
  }

I used this, which require to import android.content.ActivityNotFoundException; , which one is better?

try {   
String url = "data";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
activity.startActivity(i);
  } catch (ActivityNotFoundException e) {
    //Exception here
  }
  • 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-05-27T21:23:56+00:00Added an answer on May 27, 2026 at 9:23 pm

    Realistically, unless you’re importing hundreds of classes, I doubt you’ll see any performance decrease.

    That being said, in practice you should only import what you need. I.e. If you need something specific from that ActivityNotFoundException, or only want to catch that type of exception, definitely use it. But if you don’t, using its superclass will take a very slight load off of the performance.

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

Sidebar

Related Questions

I have a model Task which will HABTM many TaskTargets. When it comes to
I'm working on a large project (for me) which will have many classes and
Many editors will notice when a file changes out from under them. Are there
I am creating a portal where many sites will run of the same MVC
I'm setting up a database using PHPMyAdmin and many fields will be large chunks
I am trying to set up a clean vm I will use in many
I use VIM editor for PHP, i know many people will point to PDT
Many times I will use the same font scheme for static text in a
Like many web applications (business) the customer wants a form that will search across
In many situations, JavaScript parsers will insert semicolons for you if you leave them

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.