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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:50:21+00:00 2026-06-03T09:50:21+00:00

How to open a new intent when there are spaces within the array (such

  • 0

How to open a new intent when there are spaces within the array (such as “Hello World”) The class I’m trying to access is called startingPoint.

It gives me an error as there cannot be any spaces within the -> android:name=””

Is there any workaround?

Thanks in advance

Root.java

public class Root extends ListActivity {

String classes[] = { "Hello World", "Another Item", "Email"};

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    setListAdapter(new ArrayAdapter<String>(Root.this,
            R.layout.root, classes));
}

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    // TODO Auto-generated method stub
    super.onListItemClick(l, v, position, id);
    String MENU_CHOICE = classes[position];
    try {
        Class ourClass = Class.forName("se.hello.visboken." + MENU_CHOICE);
        Intent ourIntent = new Intent(Root.this, ourClass);
        startActivity(ourIntent);
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    }
}
}

My manifest looks like this

    <activity
        android:name=".Splash"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".Root"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="se.hello.visboken.ROOT" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name=".startingPoint"
        android:label="Hello World" >
        <intent-filter>
            <action android:name="se.hello.visboken.startingPoint" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>
  • 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-03T09:50:22+00:00Added an answer on June 3, 2026 at 9:50 am

    In your case, the Activity you need to launch is startingPoint, not Hello World. Hello World is the title of that activity.


    Update:

    Create another string array of same size (must) but contains classes’ names inside, not titles.

    String tmp[] = { "startingPoint", "anotherClass1", "anotherClass2"};
    

    and in onListItemClick, read it as below:

    String MENU_CHOICE = tmp[position];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to VSDO, and i want to open new template/word popup window within
I am trying open a new window using url.Action. And the new Window url
I have some problem with my open new window popup which it can read
I have window form in my WPF Application when I open new window from
I need to open a new window from code-behind on post-back if a specific
I cannot open a new window in QT. I new in QT so I
If I open a new browser window and open a new page in it
I used to be able to open a new buffer in Emacs quickly using
When I use FuzzyFinder plugin to open a new file in MacVim, it opens
i use the code below to open a new window when a user drops

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.