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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:17:23+00:00 2026-06-18T01:17:23+00:00

I am trying to develop a chat room for an Android App. On the

  • 0

I am trying to develop a chat room for an Android App.

On the first screen, a list view is displayed. On clicking on one of the items in listview, an activity is launched in whichh I am displaying two buttons called as Chat and Draw. When I click on chat I am launching another activy called as DisplayMessageActiviy in which there is an area for EditText and a button called as Send.

However, when I click on Chat, I am getting the following error ::
Unfortunately My Fist App has stopped working.

I am using the following lines of code :

SingleListActivity.java :

//chatMessage is the xfunction to be run on clicking on chat button
public void chatMessage(View view) 
{
    Intent intent_chat = new Intent(this, DisplayMessageActivity.class);
    //EditText editText = (EditText) findViewById(R.id.edit_message);
    //String message = editText.getText().toString();
    //intent_chat.putExtra(EXTRA_MESSAGE, message);
    startActivity(intent_chat);
}

DisplayMessageActivity.java :

public class DisplayMessageActivity extends Activity {

@SuppressLint("NewApi")

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

}

public void displayChat(View view) 
{
    onResume();
}

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
    TextView text = (TextView) findViewById(R.id.chatWindow);
    EditText editBox = (EditText)findViewById(R.id.chatBox);

    String str = text.getText().toString(); 
    text.setText(str +"\n"+editBox.getText().toString());
    editBox.setText("");       

    editBox.setHint("Type in here");

}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        NavUtils.navigateUpFromSameTask(this);
        return true;
    }
    return super.onOptionsItemSelected(item);
}

}

I am getting the following error in LogCat :

01-30 10:37:40.055: E/AndroidRuntime(724): FATAL EXCEPTION: main
01-30 10:37:40.055: E/AndroidRuntime(724): java.lang.IllegalStateException: Could not execute method of the activity
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.view.View$1.onClick(View.java:3597)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.view.View.performClick(View.java:4202)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.view.View$PerformClick.run(View.java:17340)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.os.Handler.handleCallback(Handler.java:725)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.os.Handler.dispatchMessage(Handler.java:92)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.os.Looper.loop(Looper.java:137)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.app.ActivityThread.main(ActivityThread.java:5039)
01-30 10:37:40.055: E/AndroidRuntime(724):  at java.lang.reflect.Method.invokeNative(Native Method)
01-30 10:37:40.055: E/AndroidRuntime(724):  at java.lang.reflect.Method.invoke(Method.java:511)
01-30 10:37:40.055: E/AndroidRuntime(724):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-30 10:37:40.055: E/AndroidRuntime(724):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-30 10:37:40.055: E/AndroidRuntime(724):  at dalvik.system.NativeStart.main(Native Method)
01-30 10:37:40.055: E/AndroidRuntime(724): Caused by: java.lang.reflect.InvocationTargetException
01-30 10:37:40.055: E/AndroidRuntime(724):  at java.lang.reflect.Method.invokeNative(Native Method)
01-30 10:37:40.055: E/AndroidRuntime(724):  at java.lang.reflect.Method.invoke(Method.java:511)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.view.View$1.onClick(View.java:3592)
01-30 10:37:40.055: E/AndroidRuntime(724):  ... 11 more
01-30 10:37:40.055: E/AndroidRuntime(724): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.myfirstapp/com.example.myfirstapp.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
01-30 10:37:40.055: E/AndroidRuntime(724):  at   android.app.Activity.startActivityForResult(Activity.java:3370)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.app.Activity.startActivityForResult(Activity.java:3331)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.app.Activity.startActivity(Activity.java:3566)
01-30 10:37:40.055: E/AndroidRuntime(724):  at android.app.Activity.startActivity(Activity.java:3534)
01-30 10:37:40.055: E/AndroidRuntime(724):  at com.example.myfirstapp.SingleListActivity.chatMessage(SingleListActivity.java:42)
01-30 10:37:40.055: E/AndroidRuntime(724):  ... 14 more

AndroidManifet.xml ::

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
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" >
    <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=".SingleListItem"
        android:label="@string/title_activity_single_list_item" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

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

    <activity
        android:name="com.example.appfirst.DisplayMessageActivity"
        android:label="@string/title_activity_display_message"
        android:parentActivityName="com.example.myfirstapp.MainActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.myfirstapp.MainActivity" />
    </activity>
</application>

Can someone help me to sort out the error ??Thanks and Regards.

  • 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-18T01:17:24+00:00Added an answer on June 18, 2026 at 1:17 am

    You have to post full stack-trace (logcat errors) and full code with your question

    anyway just assumption I think problem is here (Assumption – More details needed)

    public void displayChat(View view) 
    {
        onResume();
    }
    

    You can never explicitly call onResume() in Android Activity..

    Make a function which has a UI update code, write it in displayChat(View view)

    Like,

    public void displayChat(View view) 
    {
         updateUI();
    }
    

    Update:

    However, when I click on Chat, I am getting the following error :: Unfortunately My Fist App has stopped working
    

    Are you sure you have inserted DisplayMessageActivity in activity tag of AndroidManifest.xml file.

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

Sidebar

Related Questions

Trying to develop an android app that integrates social networking, and the first one
I am trying to develop a chat room for an Android App. I have
I' trying to develop a screen on my android app like facebook login (App
Im trying to develop my first ASP.NET MVC web app and have run into
I was trying to develop a message chat application for LAN (Windows Store App)
I am trying to develop a live video chat app using flash and rtmfp
Iam trying to develop an iphone app having tab view as the base, within
I' trying to develop an Android app and I'm currently stuck with something. I
I am trying develop an Android app which uses Google maps. So for the
im trying to develop an app for a win CE mobile device that downloads

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.