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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:35:49+00:00 2026-06-07T13:35:49+00:00

I am getting the following error: 07-11 17:33:27.250: E/AndroidRuntime(1675): java.lang.RuntimeException: Unable to start activity

  • 0

I am getting the following error:

07-11 17:33:27.250: E/AndroidRuntime(1675): java.lang.RuntimeException: Unable to start activity ComponentInfo{uk.co.myapp.gtvremote/uk.co.myapp.gtvremote.SlidepuzzleActivity}: java.lang.NullPointerException

Not sure what I have done wrong, welcome any suggestions and/or comments.

Also you may note from the code that I am trying to reuse the AnymoteClientService. I am assuming that the way I have done it here is correct, is it?
:

Manifest excerpt:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="uk.co.myapp.gtvremote"
    android:versionCode="1"
    android:versionName="1.0" >

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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <service android:name="com.example.google.tv.anymotelibrary.client.AnymoteClientService" >
        </service>

        <activity
            android:name="com.example.google.tv.anymotelibrary.connection.PairingActivity"
            android:configChanges="orientation"
            android:label="Pairing with TV"
            android:launchMode="singleTop" />
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SlidepuzzleActivity"
            android:label="@string/title_activity_slidepuzzle" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-feature
        android:name="android.hardware.touchscreen"
        android:required="true" />
    <uses-feature
        android:name="android.hardware.wifi"
        android:required="true" />

</manifest>

MainActivity.java excerpt:

Button testButton = (Button) findViewById(R.id.testButton);

...

testButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                Intent myIntent = new Intent(MainActivity.this, SlidepuzzleActivity.class);
//THIS IS WHERE I THINK THE EXCEPTION IS BEING THROWN
                MainActivity.this.startActivity(myIntent);
            }
        });

SlidepuzzleActivity.java:

public class SlidepuzzleActivity extends Activity implements ClientListener{

    private AnymoteClientService mAnymoteClientService;
    private Context mContext;

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

        ImageButton piece1x1 = (ImageButton) findViewById(R.id.piece1x1);
        ImageButton piece1x2 = (ImageButton) findViewById(R.id.piece1x2);
        ImageButton piece1x3 = (ImageButton) findViewById(R.id.piece1x3);
        ImageButton piece2x1 = (ImageButton) findViewById(R.id.piece2x1);
        ImageButton piece2x2 = (ImageButton) findViewById(R.id.piece2x2);
        ImageButton piece2x3 = (ImageButton) findViewById(R.id.piece2x3);
        ImageButton piece3x1 = (ImageButton) findViewById(R.id.piece3x1);
        ImageButton piece3x2 = (ImageButton) findViewById(R.id.piece3x2);
        ImageButton piece3x3 = (ImageButton) findViewById(R.id.piece3x3);

        Intent intent = new Intent(mContext, AnymoteClientService.class);
        bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

    }

    private ServiceConnection mConnection = new ServiceConnection() {


        /*
         * ServiceConnection listener methods.
         */
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {

            mAnymoteClientService = ((AnymoteClientService.AnymoteClientServiceBinder) service)
                    .getService();
            mAnymoteClientService.attachClientListener(SlidepuzzleActivity.this);
        }

        @Override
        public void onServiceDisconnected(ComponentName name) {
            mAnymoteClientService.detachClientListener(SlidepuzzleActivity.this);
            mAnymoteClientService = null;   
        }

    };

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.slidepuzzle, menu);
        return true;
    }

    @Override
    public void onConnected(AnymoteSender anymoteSender) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onDisconnected() {
        // TODO Auto-generated method stub

    }

    @Override
    public void onConnectionError() {
        // TODO Auto-generated method stub

    }

    @Override
    protected void onDestroy() {
        if (mAnymoteClientService != null) {
            mAnymoteClientService.detachClientListener(this);
        }
        unbindService(mConnection);
        super.onDestroy();
    }


}

Cheers

REQUESTED STACK TRACE:

07-11 17:33:27.250: E/AndroidRuntime(1675): FATAL EXCEPTION: main
07-11 17:33:27.250: E/AndroidRuntime(1675): java.lang.RuntimeException: Unable to start activity ComponentInfo{uk.co.myapp.gtvremote/uk.co.myapp.gtvremote.SlidepuzzleActivity}: java.lang.NullPointerException
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.os.Looper.loop(Looper.java:137)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.ActivityThread.main(ActivityThread.java:4424)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at java.lang.reflect.Method.invokeNative(Native Method)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at java.lang.reflect.Method.invoke(Method.java:511)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at dalvik.system.NativeStart.main(Native Method)
07-11 17:33:27.250: E/AndroidRuntime(1675): Caused by: java.lang.NullPointerException
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.content.ComponentName.<init>(ComponentName.java:75)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.content.Intent.<init>(Intent.java:3175)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at uk.co.myapp.gtvremote.SlidepuzzleActivity.onCreate(SlidepuzzleActivity.java:39)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.Activity.performCreate(Activity.java:4465)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
07-11 17:33:27.250: E/AndroidRuntime(1675):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
07-11 17:33:27.250: E/AndroidRuntime(1675):     ... 11 more

I have marked in the SlidepuzzleActivity.java excerpt where the exception is being thrown with //THIS IS WHERE I THINK THE EXCEPTION IS BEING THROWN

  • 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-07T13:35:50+00:00Added an answer on June 7, 2026 at 1:35 pm

    As far as I can see mContext is null; and it may be causing this exception when instantiating the Intent.

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

Sidebar

Related Questions

I am getting following error message: java.lang.IllegalStateException: Neither BindingResult nor plain target object for
I am getting following error while Version Creating My Database. 01-18 12:08:01.157: ERROR/AndroidRuntime(3079): Caused
I am getting following error when I try to open MySQL Connection; MySql.Data.MySqlClient.MySqlException: Unable
immediately after has_many_polymorphs install with ruby script/plugin install git://github.com/fauna/has_many_polymorphs.git i start getting following error
Am getting following error message on calling WCF service: The formatter threw an exception
I am Getting following error on exporting the video using [exportSession exportAsynchronouslyWithCompletionHandler:^ Error: -[TiBlob
I am getting following error while installing the application on my device. before running
i am getting following error while getting data from dictionary -[__NSCFString objectForKey:]: unrecognized selector
I'm getting following error when I try to log onto phpMyAdmin. User * *
I am getting following error when I am trying to get WebResponse using WebResponse

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.