How to get error stack in Android Emulator

durwinwilson

New Member
Hello i use AVD and I don't know how to error stack when I get -> app stopped working force quit...I wanted to code simple listener but there was an error -> i know that error is caused by setOnClick listener and this is probalby null pointer exception, but I would like to see it on stack error. Please tell me also why there is an exception. I attach the part of XML\[code\]package com.example.pierwsza; import android.os.Bundle; import android.app.Activity; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.widget.Button;import android.support.v4.app.NavUtils;class MainActivity extends Activity implements OnClickListener{Button b;@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); b = (Button) findViewById(R.id.button3); // b.setOnClickListener((android.view.View.OnClickListener) this); <--- ERROR}@Overridepublic boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true;}public void onClick(DialogInterface dialog, int which) { //b.setText("Ale to dziwne");}}\[/code\]XML of that BUTTON\[code\] <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/linearLayout1" android:layout_marginBottom="29dp" android:layout_toLeftOf="@+id/textView1" android:text="Jakis przycisk" />\[/code\]
 
Back
Top