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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:00:23+00:00 2026-05-26T18:00:23+00:00

Especially android-developers :) I have some troubles with application menu which i try to

  • 0

Especially android-developers 🙂
I have some troubles with application menu which i try to create.

When I click on some button – apllication says that process stopped unexpectedly

I make it almost like in manual here(http://www.droidnova.com/creating-game-menus-in-android,518.html) but their sample works and my code not!
I don’t understand what i’ve done wrong, please, can somebody help?

main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget32"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TableLayout
android:id="@+id/widget28"
android:layout_width="295px"
android:layout_height="600px"
android:orientation="vertical"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
>
<Button
android:id="@+id/StartGame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/startgame_button"
>
</Button>
<TextView
android:id="@+id/widget34"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<Button
android:id="@+id/Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/help_button" 
>
</Button>
<TextView
android:id="@+id/widget35"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<Button
android:id="@+id/Highscores"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/highscores_button" 
>
</Button>
<TextView
android:id="@+id/widget36"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<Button android:id="@+id/Quit" android:background="@drawable/quit_button" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>

</TableLayout>
</RelativeLayout>

startgame_button.xml for example

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/start_game_highlighted" /> 
    <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/start_game_pressed" /> 
    <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/start_game_pressed" /> 
    <item android:drawable="@drawable/start_game" /> 
</selector>

Mani menu activity

package game.mainmenu;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.Button;
import game.main.R;

public class MainMenuActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        final Activity t = this;
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN );

        Button StartGameButton = (Button)findViewById(R.id.StartGame);//кнопка начала игры
        StartGameButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                Intent StartGameIntent = new Intent(MainMenuActivity.this, StartGame.class);
                startActivity(StartGameIntent);
            }
        });

        Button HelpButton = (Button)findViewById(R.id.Help);//кнопка help
        HelpButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                Intent HelpIntent = new Intent(MainMenuActivity.this, Help.class);
                startActivity(HelpIntent);
            }
        });

        Button OptionsButton = (Button)findViewById(R.id.Highscores);//кнопка 
        OptionsButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                Intent OptionsIntent = new Intent(MainMenuActivity.this, Highscores.class);
                startActivity(OptionsIntent);
            }
        });

        Button QuitButton = (Button)findViewById(R.id.Quit);//кнопка 
        QuitButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                t.finish();
            }
        });


    }


}

and an example StartGame activity

public class StartGame extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.copy);      

    }
}

and copy.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget32"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>

<TextView android:text="blah blah blah" 
android:id="@+id/TextView01" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"></TextView>
</RelativeLayout>

logcat track

11-05 22:47:53.166: INFO/ActivityManager(67): Displayed game.main/game.mainmenu.MainMenuActivity: +15s468ms
11-05 22:47:59.306: DEBUG/dalvikvm(319): GC_EXPLICIT freed 2K, 54% free 2539K/5511K, external 1625K/2137K, paused 1033ms
11-05 22:48:05.456: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol
11-05 22:48:06.117: DEBUG/dalvikvm(150): GC_EXPLICIT freed 100K, 49% free 3039K/5895K, external 6009K/7443K, paused 437ms
11-05 22:48:06.997: INFO/ActivityManager(67): Starting: Intent { act=lolhelp } from pid 851
11-05 22:48:07.036: DEBUG/AndroidRuntime(851): Shutting down VM
11-05 22:48:07.036: WARN/dalvikvm(851): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-05 22:48:07.137: ERROR/AndroidRuntime(851): FATAL EXCEPTION: main
11-05 22:48:07.137: ERROR/AndroidRuntime(851): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=lolhelp }
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.app.Activity.startActivityForResult(Activity.java:2827)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.app.Activity.startActivity(Activity.java:2933)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at game.mainmenu.MainMenuActivity$2.onClick(MainMenuActivity.java:40)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.view.View.performClick(View.java:2485)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.view.View$PerformClick.run(View.java:9080)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.os.Handler.handleCallback(Handler.java:587)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.os.Looper.loop(Looper.java:123)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at android.app.ActivityThread.main(ActivityThread.java:3683)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at java.lang.reflect.Method.invokeNative(Native Method)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at java.lang.reflect.Method.invoke(Method.java:507)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-05 22:48:07.137: ERROR/AndroidRuntime(851):     at dalvik.system.NativeStart.main(Native Method)
11-05 22:48:07.227: WARN/ActivityManager(67):   Force finishing activity game.main/game.mainmenu.MainMenuActivity
11-05 22:48:07.847: WARN/ActivityManager(67): Activity pause timeout for HistoryRecord{4065f5c0 game.main/game.mainmenu.MainMenuActivity}
11-05 22:48:22.997: WARN/ActivityManager(67): Activity destroy timeout for HistoryRecord{4065f5c0 game.main/game.mainmenu.MainMenuActivity}

UPD!

Well problem solved!
It was because of idk why but without full path for activities in AndroidManifest

<activity android:name="game.mainmenu.Help"//like here. it dosen't work if it's just ".Help"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
  • 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-26T18:00:24+00:00Added an answer on May 26, 2026 at 6:00 pm

    Have you registered your classes in the Manifest? Every class that you want to use as an intent needs to be registered in the manifest, or your application won’t be able to find it.

    Like this:

     <activity android:name="Help" android:label="@string/app_name"  
    
            >
            <intent-filter>
                <action android:name="this.can.be.anything.unique" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    

    The action android:name is set so you can call it by name rather than calling it via Help.class.

    That way in your code you’d be able to call it like this:

    Intent helpIntent = new Intent("this.can.be.anything.unique");
    startActivity(helpIntent);
    

    But that’s optional. Still, you have to have an entry in the manifest for the class for any of this to work.

    Also it’s good practice to set your flags first and then set the content…

        final Activity t = this;
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                WindowManager.LayoutParams.FLAG_FULLSCREEN );
        setContentView(R.layout.main);//move this here
    

    If none of that helps, post your stack trace so we can see what else might be the problem.

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

Sidebar

Related Questions

Which is the best framework to develop cross platform application. Especially for android and
I have android app which works fine. And now I want to add some
I'm a newbie of Android world. I'm so confused about some terms. Especially, why
Do functions have a performance penalty in GLSL (especially on iOS and Android implementations)?
I need to work on the internals of android, especially create and test new
I want to create an Android application that is a client for an Internet
I need to create a common entity layer for my mobile phone application developments.(especially
Iam a great fan of javascript frameworks especially jQuery .I have always wanted to
I have been searching on google for information regarding application passwords and SQLite security
I am encounter more and more android devices with irregular layouts, especially in the

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.