[android-developers] Re: NullPointerException ... arrrggghhh ... newbie LOST!
does R.id.btnRetrieveDoc event exist? On Saturday, August 25, 2012 12:45:20 PM UTC-7, KinnMirr wrote: When I run below activity, I get an exception. I've wrapped the exception in an AlertDialog. Here's what the dialog shows. * null null null java.lang.NullPointerException * Where do I even START looking for a problem? I've commented-out everything I can think of and the exception still happens. ar! I'm a newbie and I'm stumped! Here's the Activity AlertDialog marked with import android.os.Bundle; import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class EncDocRetrieve extends Activity { Button retrieveDoc; //EditText DocName; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setContentView(R.layout.activity_enc_doc_retrieve); retrieveDoc = (Button) findViewById(R.id.btnRetrieveDoc); retrieveDoc.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //DocName = (EditText) findViewById(R.id.edtextDocUserName); Intent intent = new Intent(EncDocRetrieve.this, DecryptKeyGet.class); //intent.putExtra(android.content.Intent.EXTRA_TEXT, DocName //.getText().toString()); startActivity(intent); } }); } catch (Exception e) { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle(Opps Exception); String err = e.getLocalizedMessage() + \n + e.getCause() + \n + e.getMessage() + \n + e.toString(); dialog.setMessage(err); dialog.setNeutralButton(Cool, null); dialog.create().show(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_enc_doc_retrieve, menu); return true; } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: NullPointerException ... arrrggghhh ... newbie LOST!
cross check with your xml, that you have used same names as in xml. On Mon, Aug 27, 2012 at 2:32 PM, Jason Sesso djse...@gmail.com wrote: does R.id.**btnRetrieveDoc event exist? On Saturday, August 25, 2012 12:45:20 PM UTC-7, KinnMirr wrote: When I run below activity, I get an exception. I've wrapped the exception in an AlertDialog. Here's what the dialog shows. * null null null java.lang.NullPointerException * Where do I even START looking for a problem? I've commented-out everything I can think of and the exception still happens. ar! I'm a newbie and I'm stumped! Here's the Activity AlertDialog marked with import android.os.Bundle; import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.View.**OnClickListener; import android.widget.Button; public class EncDocRetrieve extends Activity { Button retrieveDoc; //EditText DocName; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(**savedInstanceState); try { setContentView(R.layout.**activity_enc_doc_retrieve); retrieveDoc = (Button) findViewById(R.id.** btnRetrieveDoc); retrieveDoc.**setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //DocName = (EditText) findViewById(R.id.** edtextDocUserName); Intent intent = new Intent(EncDocRetrieve.this, **DecryptKeyGet.class); //intent.putExtra(android.**content.Intent.EXTRA_TEXT, DocName //.getText().toString()); startActivity(intent); } }); } catch (Exception e) { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle(Opps Exception); String err = e.getLocalizedMessage() + \n + e.getCause() + \n + e.getMessage() + \n + e.toString(); dialog.setMessage(err); dialog.setNeutralButton(Cool**, null); dialog.create().show(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.**menu.activity_enc_doc_**retrieve, menu); return true; } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks Regards, Renuka -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: NullPointerException ... arrrggghhh ... newbie LOST!
Look at your logcat output... It will point you to the exact file and line number where the exception is occurring... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Mon, Aug 27, 2012 at 5:48 AM, Renuka Deshpande renukanil.deshpa...@gmail.com wrote: cross check with your xml, that you have used same names as in xml. On Mon, Aug 27, 2012 at 2:32 PM, Jason Sesso djse...@gmail.com wrote: does R.id.**btnRetrieveDoc event exist? On Saturday, August 25, 2012 12:45:20 PM UTC-7, KinnMirr wrote: When I run below activity, I get an exception. I've wrapped the exception in an AlertDialog. Here's what the dialog shows. * null null null java.lang.NullPointerException * Where do I even START looking for a problem? I've commented-out everything I can think of and the exception still happens. ar! I'm a newbie and I'm stumped! Here's the Activity AlertDialog marked with import android.os.Bundle; import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.view.Menu; import android.view.View; import android.view.View.**OnClickListener; import android.widget.Button; public class EncDocRetrieve extends Activity { Button retrieveDoc; //EditText DocName; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(**savedInstanceState); try { setContentView(R.layout.**activity_enc_doc_retrieve); retrieveDoc = (Button) findViewById(R.id.** btnRetrieveDoc); retrieveDoc.**setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //DocName = (EditText) findViewById(R.id.* *edtextDocUserName); Intent intent = new Intent(EncDocRetrieve.this, **DecryptKeyGet.class); //intent.putExtra(android.**content.Intent.EXTRA_TEXT, DocName //.getText().toString()); startActivity(intent); } }); } catch (Exception e) { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle(Opps Exception); String err = e.getLocalizedMessage() + \n + e.getCause() + \n + e.getMessage() + \n + e.toString(); dialog.setMessage(err); dialog.setNeutralButton(Cool**, null); dialog.create().show(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.**menu.activity_enc_doc_**retrieve, menu); return true; } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks Regards, Renuka -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en