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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:25:55+00:00 2026-06-04T22:25:55+00:00

i am new to android. While i am running my application, it is running

  • 0

i am new to android.
While i am running my application, it is running well in landscape mode, but in portrait mode, application is forcefully closed giving the following in log

05-31 16:48:30.958: W/KeyCharacterMap(428): No keyboard for id 0
05-31 16:48:30.958: W/KeyCharacterMap(428): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
05-31 16:50:45.728: D/AndroidRuntime(484): Shutting down VM
05-31 16:50:45.728: W/dalvikvm(484): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-31 16:50:45.758: E/AndroidRuntime(484): FATAL EXCEPTION: main
05-31 16:50:45.758: E/AndroidRuntime(484): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kalmas/com.kalmas.Kalma2}: java.lang.NullPointerException
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.os.Looper.loop(Looper.java:123)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-31 16:50:45.758: E/AndroidRuntime(484):  at java.lang.reflect.Method.invokeNative(Native Method)
05-31 16:50:45.758: E/AndroidRuntime(484):  at java.lang.reflect.Method.invoke(Method.java:521)
05-31 16:50:45.758: E/AndroidRuntime(484):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-31 16:50:45.758: E/AndroidRuntime(484):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-31 16:50:45.758: E/AndroidRuntime(484):  at dalvik.system.NativeStart.main(Native Method)
05-31 16:50:45.758: E/AndroidRuntime(484): Caused by: java.lang.NullPointerException
05-31 16:50:45.758: E/AndroidRuntime(484):  at com.kalmas.Kalma2.onCreate(Kalma2.java:52)
05-31 16:50:45.758: E/AndroidRuntime(484):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-31 16:50:45.758: E/AndroidRuntime(484):  at          android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-31 16:50:45.758: E/AndroidRuntime(484):  ... 11 more
05-31 16:50:48.108: I/Process(484): Sending signal. PID: 484 SIG: 9

the code of my Kalma2.java is

package com.kalmas;

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.widget.ImageView;

public class Kalma2 extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        final MediaPlayer   kalma2  =   MediaPlayer.create(this,   R.raw.kalma2);
        super.onCreate(savedInstanceState);
    setContentView(R.layout.kalma2);

    ImageView prev2 =   (ImageView)findViewById(R.id.prev2);

    prev2.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            kalma2.stop();
            startActivity(new Intent(Kalma2.this,Kalma1.class));
        }
    });

    ImageView   next2   =   (ImageView)findViewById(R.id.next2);
    next2.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            kalma2.stop();
            startActivity(new Intent(Kalma2.this,Kalma3.class));
        }
    });

    ImageView pause =   (ImageView)findViewById(R.id.pause2);
    pause.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            kalma2.pause();
        }
    });

    ImageView play  =   (ImageView)findViewById(R.id.play2);
    play.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            kalma2.start();
        }
    });

    ImageView kalma =   (ImageView)findViewById(R.id.kalma2);

    kalma.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            kalma2.start();
        }
    });



}

}
  • 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-04T22:25:57+00:00Added an answer on June 4, 2026 at 10:25 pm

    As far as I can tell, on line 52 you try to attach a click listener to an ImageView.

    ImageView play  =   (ImageView)findViewById(R.id.play2);
    play.setOnClickListener(new OnClickListener() { ...
    

    Are you sure your layout contains an ImageView with id play2? Would be nice to have the code for kalma2.xml too 🙂

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

Sidebar

Related Questions

I am getting the following error while running my android project in which I
I'm developing an Android application and I have a problem running a new thread
I am new to Android development and facing a problem while using AndEngine. I
i am creating a new android application.i am using the table layout. I have
I have developed an application in android and also deployed in the mobile. While
I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting
In an Android application I run a task in a separate thread. While the
While creating a new android project in eclipse 3.5, i have selected Android 2.1
I have this app that is running in portrait mode and as a part
I wanted a file explorer in my application hence while googling I found Android

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.