Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Event Listener's initialize crashes app
    primarykey
    data
    text
    <p>I am using the AVD Emulator to run apk. I have created a simple activity, which has two buttons, however whenever I write code for any of them, the app won't start, excluding to initialize them.</p> <p>If I declare the actionlistener like below (code between asterisks) it causes the apk to throw an error on start up. I have attempted to place " <code>android:onClick="btnLoginClicked</code>" in the xml, however I get the same result.</p> <p>Anyone able to tell me why this is? I get the feeling I'm missing something really simple.</p> <pre><code>package uk.ac.aber.cs22120.fuzzyNinja.pathFinder; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; //import android.view.View; import android.widget.*; public class ActivityLogin extends Activity { private Button btnLogin; private ProgressBar progressBar_Login; // @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); btnLogin = (Button) findViewById(R.id.btnLogin); progressBar_Login = (ProgressBar) findViewById(R.id.progressBar_Login); *************************** //btnLogin.setOnClickListener(btnLoginClickListener); *************************** setContentView(R.layout.activity_login); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_login, menu); return true; } ************************* //private OnClickListener btnLoginClickListener = new OnClickListener(){ // public void onClick(View v){ // // } //}; ************************* } </code></pre> <p>The Following is my XML for this Activity: <a href="https://www.dropbox.com/s/d91t6xqrusi1s2t/activity_login.xml" rel="nofollow">https://www.dropbox.com/s/d91t6xqrusi1s2t/activity_login.xml</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload