Results 1 to 4 of 4
  1. #1
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Unfortunately Application has stopped

    i'm new to android i don't know what is wrong with my code any body can help
    i'm getting the error on emulator Application has stopped
    Java Code:
    package com.example.Yamba;
    
    import android.app.Activity;
    import android.os.Bundle;
    import winterwell.jtwitter.Twitter;
    import android.util.Log;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.EditText;
    
    
    public class Front extends Activity {
       private static final String TAG = "Status_Activate";
        EditText edittext;
        Button UpdateButton;
        Twitter twitter;
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            edittext = (EditText) findViewById(R.id.textView);
            UpdateButton = (Button) findViewById(R.id.button);
            twitter = new Twitter("Student","Password");
            twitter.setAPIRootUrl("http://yamba.marakana.com/api");
            UpdateButton.setOnClickListener(new OnClickListener() {
    
                public void onClick(View view) {
                    twitter.setStatus(edittext.getText().toString());
                    Log.d(TAG,"onClick");
                }
            });
    
        }
    
    
    
    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default Re: Unfortunately Application has stopped

    Look in the Logcat console for an error message.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: Unfortunately Application has stopped

    Quote Originally Posted by Norm View Post
    Look in the Logcat console for an error message.
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.Yamba/com.example.Yamba.Front}: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
    at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2180)
    at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2230)

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,882
    Rep Power
    25

    Default Re: Unfortunately Application has stopped

    What happened to the rest of the Logcat? Did you post enough to show where the error happens?
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. The application has stopped responding
    By cdr_nitjsr@yahoo.com in forum Android
    Replies: 3
    Last Post: 07-14-2013, 01:19 AM
  2. unfortunately application has stopped
    By Emmarock in forum Entertainment
    Replies: 3
    Last Post: 07-08-2013, 08:01 PM
  3. Build stopped
    By Nerijus in forum New To Java
    Replies: 0
    Last Post: 04-26-2010, 09:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •