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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:16:26+00:00 2026-06-07T09:16:26+00:00

I have the exception listed below and i added the code, before creating this

  • 0

I have the exception listed below and i added the code, before creating this question i googled this problem but didn’t find a solution and i can’t find the problem or anyhelp on ohter posts with the same error so what i am missing?

Emulator android version 2.2 api level 8

Here is the problem:

07-07 19:40:20.782: E/AndroidRuntime(588): FATAL EXCEPTION: main
07-07 19:40:20.782: E/AndroidRuntime(588): java.lang.IllegalStateException: Could not execute method of the activity
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.view.View$1.onClick(View.java:2072)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.view.View.performClick(View.java:2408)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.view.View$PerformClick.run(View.java:8816)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.os.Handler.handleCallback(Handler.java:587)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.os.Handler.dispatchMessage(Handler.java:92)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.os.Looper.loop(Looper.java:123)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.app.ActivityThread.main(ActivityThread.java:4627)
07-07 19:40:20.782: E/AndroidRuntime(588):  at java.lang.reflect.Method.invokeNative(Native Method)
07-07 19:40:20.782: E/AndroidRuntime(588):  at java.lang.reflect.Method.invoke(Method.java:521)
07-07 19:40:20.782: E/AndroidRuntime(588):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-07 19:40:20.782: E/AndroidRuntime(588):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-07 19:40:20.782: E/AndroidRuntime(588):  at dalvik.system.NativeStart.main(Native Method)
07-07 19:40:20.782: E/AndroidRuntime(588): Caused by: java.lang.reflect.InvocationTargetException
07-07 19:40:20.782: E/AndroidRuntime(588):  at app.hearts.multiplayer.MainActivity.onPlayClick(MainActivity.java:24)
07-07 19:40:20.782: E/AndroidRuntime(588):  at java.lang.reflect.Method.invokeNative(Native Method)
07-07 19:40:20.782: E/AndroidRuntime(588):  at java.lang.reflect.Method.invoke(Method.java:521)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.view.View$1.onClick(View.java:2067)
07-07 19:40:20.782: E/AndroidRuntime(588):  ... 11 more
07-07 19:40:20.782: E/AndroidRuntime(588): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { cmp=app.hearts.multiplayer/.GameActivity } from ProcessRecord{44fc09f0 588:app.hearts.multiplayer/10032} (pid=588, uid=10032) requires android.permission.ACCESS_NETWORK_STATE
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.os.Parcel.readException(Parcel.java:1247)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.os.Parcel.readException(Parcel.java:1235)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.app.Activity.startActivityForResult(Activity.java:2817)
07-07 19:40:20.782: E/AndroidRuntime(588):  at android.app.Activity.startActivity(Activity.java:2923)
07-07 19:40:20.782: E/AndroidRuntime(588):  ... 15 more

MainActivity.java:

package app.hearts.multiplayer;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;    
import android.widget.EditText;

public class MainActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}



public void onPlayClick(View view)
{
    Intent gameIntent = new Intent(MainActivity.this, GameActivity.class);
    startActivity(gameIntent);
}
}

activity_main.xml :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout2"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background"
    android:gravity="right"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1.05"
        android:scaleType="fitXY"
        android:src="@drawable/hearts_hat" />

    <LinearLayout
        android:id="@+id/LinearLayout1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="0.70"
        android:orientation="vertical"
        android:paddingRight="@dimen/padding_small"
        android:paddingTop="@dimen/padding_large" >


        <ImageButton
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_weight="0.00"
            android:adjustViewBounds="true"
            android:background="@drawable/select_play"
            android:onClick="onPlayClick"
            android:clickable="true"
            android:paddingTop="@dimen/padding_medium" />

        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="@dimen/padding_large"
            android:paddingTop="@dimen/padding_large" >
        </TableRow>

        <ImageButton
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_weight="0.00"
            android:background="@drawable/select_highscore"
            android:clickable="true"
            android:paddingTop="@dimen/padding_large" />
    </LinearLayout>

</LinearLayout>

Manifest-file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="app.hearts.multiplayer"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <application
        android:icon="@drawable/hearts_icon"
        android:label="@string/app_name"
        android:permission="android.permission.ACCESS_NETWORK_STATE"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main"
            android:screenOrientation="landscape" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".GameActivity"
            android:label="@string/title_activity_game" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

GameActivity.java:

package app.hearts.multiplayer;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

public class GameActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_game);
    }

}

activity_game.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:padding="@dimen/padding_medium"
        android:text="@string/hello_world"
        tools:context=".GameActivity" />

</RelativeLayout>
  • 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-07T09:16:28+00:00Added an answer on June 7, 2026 at 9:16 am

    From the error below:

    07-07 19:40:20.782: E/AndroidRuntime(588): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { cmp=app.hearts.multiplayer/.GameActivity } from ProcessRecord{44fc09f0 588:app.hearts.multiplayer/10032} (pid=588, uid=10032) requires android.permission.ACCESS_NETWORK_STATE
    

    It seems like you need to add ACCESS_NETWORK_STATE – add this permission using following code which should be outside of “application” tag:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example" android:versionCode="1" android:versionName="1.0" >
    
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    
        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <!-- more data goes here... -->
        </application>  
    
    </manifest>
    

    Give it a try.

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

Sidebar

Related Questions

I have a MySQL singleton class written in PHP. Its code is listed below:
The config below seemed to have worked but now its failing. I followed this
In the code below I have a StreamReader reading from a network stream. This
I have a question about session timeouts and JSF 2. I have my exception
I have a webdav function listed below: The behavior is completely unexpected.... When I
I have this question when I am studying an open source Android project. I
I'm getting the exception listed below when looking at the MainPage.xaml of a newly
Please refer to Stumped SQL Exception for JDBC I have a similar error (listed
I've been looking at this Stackoverflow question and have the answer implemented. It works
I have an exception handler for the type SqlException and I'm looking at 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.