Note that there are some explanatory texts on larger screens.

plurals
  1. POerror when linking button to class/page
    primarykey
    data
    text
    <p>Hello why wont this work? My plan is to have 2 navigate buttons that link to eternal page/classes in my application? Why does not this work and is this a good way of doing that? I think of make a if and else statement but i dont now is it is better for this action. the problem is that it become a error on } tags at the end of the application. Else the application seems to working good. I have tried to remove } tags and put in more but that does not help.</p> <pre><code>enter code here package tm.andrioid.com; import android.app.Activity; import android.app.Dialog; import android.app.ListActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.View; import android.widget.Button; import android.app.Activity; import android.os.Bundle; import android.content.Intent; import android.widget.Button; public class indexActivity extends Activity { public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Button bprodukter = (Button) findViewById(R.id.bprodukter); // to link to page 1 bprodukter.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { Intent i = new Intent(indexActivity.this, produkter.class); startActivity(i); } private void onClickbpositionButton(){ Button bposition = (Button) findViewById(R.id.bpoistion); // to link to page 2 bposition.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { Intent e = new Intent(indexActivity.this, position.class); startActivity(e); } } }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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