Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid multiscreen issue between screens
    primarykey
    data
    text
    <p>I have a multi screen app that only the first button works. alll of the other buttons crash when they go to the next java file. In the manifest I have all of them listed but I have no idea why its crashing. any ideas? package com.mike.BrowserScreen; import android.app.Activity; import android.os.Bundle; import android.widget.<em>; import android.view.</em>; import android.content.Intent; </p> <pre><code> public class BrowserScreenActivity extends Activity { /** Called when the activity is first created. */ Button flea=null; Button bu1=null; Button bu2=null; Button bu3=null; TextView tv1=null; TextView tv2=null; TextView tv3=null; TextView tv4=null; TextView tv5=null; TextView tv6=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); flea=(Button)findViewById(R.id.flea); bu1=(Button)findViewById(R.id.bu1); bu2=(Button)findViewById(R.id.bu2); bu3=(Button)findViewById(R.id.bu3); tv1=(TextView)findViewById(R.id.tv1); tv2=(TextView)findViewById(R.id.tv2); tv3=(TextView)findViewById(R.id.tv3); tv4=(TextView)findViewById(R.id.tv4); tv5=(TextView)findViewById(R.id.tv5); tv6=(TextView)findViewById(R.id.tv6); flea.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ Intent myIntent=new Intent(v.getContext(),SecondActivity.class); startActivity(myIntent); } }); bu1.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ Intent myIntent1=new Intent(v.getContext(),ThirdActivity.class); startActivity(myIntent1); } }); bu2.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ Intent myIntent2=new Intent(v.getContext(),FourthActivity.class); startActivity(myIntent2); } }); bu3.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ Intent myIntent3=new Intent(v.getContext(),FifthActivity.class); startActivity(myIntent3); } }); } } </code></pre> <p>Heres the manifest </p> <pre><code> &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".BrowserScreenActivity" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".SecondActivity"&gt;&lt;/activity&gt; &lt;activity android:name=".ThirdActivity"&gt;&lt;/activity&gt; &lt;activity android:name=".ForthActivity"&gt;&lt;/activity&gt; &lt;activity android:name=".FifthActivity"&gt;&lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <hr> <p>i figured it out in the other java files i forgot to change it to the right xml file.I will have another question on launching a website from a textview or button</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