Note that there are some explanatory texts on larger screens.

plurals
  1. POSwitching between layout in android
    text
    copied!<pre><code> public class menu extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main_activity_page); { Button but1 = (Button)findViewById(R.id.imageButton4); but1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub startActivity(new Intent("com.indore.indoreindicator.Busone")); } }); } } @Override protected void onPause() { // TODO Auto-generated method stub super.onPause(); } } </code></pre> <p>I have this line of code from my menu class</p> <p>busone class - </p> <pre><code> package com.indore.indoreindicator; import android.app.Activity; import android.os.Bundle; public class Busone extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.busmenu); } } </code></pre> <p>Android manifest file</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.indore.indoreindicator" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="com.indore.indoreindicator.MainActivityPage" 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=".menu" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.Menu" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".Busone" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="com.indore.indoreindicaotr.Busone" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Main activity page -</p> <pre><code> &lt;ImageButton android:id="@+id/imageButton4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginTop="47dp" android:layout_toLeftOf="@+id/TextView05" android:src="@drawable/bus" tools:ignore="ContentDescription" /&gt; </code></pre> <p>My application starts but fails after the splash screen, unable to move on first page. but if I comment the button coding part the applcation moves to the menu page.</p> <p>Why cant I go from the my menu page to the 2nd page named bus menu?</p>
 

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