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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:12:46+00:00 2026-05-26T05:12:46+00:00

Whenewer I want to start new activity, I use this code: Intent myIntent1 =

  • 0

Whenewer I want to start new activity, I use this code:

Intent myIntent1 = new Intent(this, Info1.class);
startActivity(myIntent1);

But, what about the case, I am getting class name from String Array? I have tried method class.forName like this:

Intent intent = new Intent(this, Class.forName(array[1]));
startActivity(intent);

But no success. It is giving me error of

java.lang.ClassNotFoundException: Info1 in loader
dalvik.system.PathClassLoader

even though in first case it started an activity successfully. I have to add that I am 100% sure array[1] contains string “Info1” and that I have Info1.class in my package.

Do you know, how to solve this?

  • 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-26T05:12:47+00:00Added an answer on May 26, 2026 at 5:12 am

    The method

    Class.forName("xxxxx");
    

    Needs fully qualified name which means you should give the name along with the package details(in which package the class exists)

    as an example

    Class.forName("com.mypackage.MyClass");
    

    Documentation Reference here

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

Sidebar

Related Questions

I'm totally new on this so I want to start with something simple. I
I want code to run whenever I create a new object. For example, see
I'm just about to start a new project of mine and am currently evaluating
I have a longer report and want to start a Matrix on a new
Whenever I want to modify a winform from another thread, I need to use
i'm using the DOMdocument class in php whenever i want to create a XML
This is a rails question about migration versions So i have a few migrations
I'm writing a class library that will offer some asynchronous processing, and want to
I have a code for new thread in a button new thread is created
What I want is that when Activity starts first time, it first checks if

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.