I am testing it on my phone. The emulator has never finished booting on my computer. How to I write errors to the logfile on the phone?
On Sat, Apr 2, 2011 at 11:08 PM, Mark Murphy <[email protected]>wrote: > Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine > LogCat and look at the stack trace associated with your "force close". > > On Sat, Apr 2, 2011 at 1:33 PM, Raghav Sood <[email protected]> wrote: > > Hi everyone, > > > > My code is as follows: > > > > import com.raghavsood.mp.R; > > > > import android.app.Activity; > > import android.os.Bundle; > > import android.view.View; > > import android.view.View.OnClickListener; > > import android.widget.ImageView; > > > > > > public class class extends Activity { > > ImageView button = (ImageView)findViewById(R.id.l1m1); > > private OnClickListener mCorkyListener = new OnClickListener() { > > public void onClick(View v) { > > button.setImageResource (R.drawable.m1s); > > } > > }; > > > > /** Called when the activity is first created. */ > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > setContentView(R.layout.main); > > > > // Register the onClick listener with the implementation above > > button.setOnClickListener(mCorkyListener); > > > > } > > } > > > > My code had no problems when the parts in greenish color were not there. > Now > > the app force closes. > > > > Please help. This is for a game I am making. > > > > > > > > -- > > Raghav Sood > > http://www.raghavsood.com/ > > http://www.androidappcheck.com/ > > http://www.telstop.tel/ > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to *Advanced* Android Development_ Version > 1.9.2 Available! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Raghav Sood http://www.raghavsood.com/ http://www.androidappcheck.com/ http://www.telstop.tel/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

