Jump to content

The 'Unfortunately your Android app has stopped' error message


Aymen1322
 Share

Recommended Posts

Bonjour,

en créant ma premiére Android app, ce message d'erreur est apparu :/

c'est quoi la solution SVP

Merci.

Code de l'application:

package com.example.helloworld;

import com.example.helloworld.R;

import android.os.Bundle;

import android.app.Activity;

import android.view.View;

import android.view.View.onclickListener;

import android.widget.Button;

import android.widget.EditText;

import android.widget.TextView;

public class MainActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

final EditText NameField = (EditText) findViewById(R.id.NameField);

final TextView TextView = (EditText) findViewById(R.id.TestView);

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

Button.setonclickListener(new onclickListener() {

public void onclick(View arg0) {

TextView.setText("Bonjour M." + NameField.getText());

}

});

}

}

Link to comment
Share on other sites

Bonjour,

Pour visionner d'où vient l'erreur, il faut regarder le logcat.

Deux possibilités :

* directement dans ton IDE.

Sur Eclipse ca donne :

logcat.png

* en ligne de commande

Aller dans le répertoire platform-tools du SDK et lancer un "adb logcat"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...