Button to open another activity
<p>I know this may seem simple, and I've tried everything mentioned in other threads, but for some reason it's not working.</p>

<p>I simply want the button on the phind.xml to open the activity_alerts.xml and vice versa, but for some reason it's not working. I guess I'm missing something simple.</p>

<p>phind.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/phind"
    android:background="#ff0000"&gt;

    &lt;TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="Alert Message!"
        android:gravity="center"
        android:textSize="36sp"
        android:textColor="@color/black"
        android:layout_weight="1"/&gt;

    &lt;Button
        android:id="@+id/disable"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Disable alert"/&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>Phind.java:</p>

<pre><code>import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.phinder.phinder.R;

public class Phind extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.phind);

        Button button = (Button) findViewById(R.id.disable);
        button.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {

                Intent i = new Intent(getApplicationContext(),ActivityAlerts.class);
                startActivity(i);
            }

        });
    }
}
</code></pre>

<p>activity_alerts.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/light_gray"
        android:orientation="vertical"
        tools:context="com.phinder.phinder.Menu.Alerts"&gt;


        &lt;Button
            android:id="@+id/test"
            android:layout_height="wrap_content"
            android:text="test your alert"
            android:height="24dp"
            android:layout_width="match_parent"/&gt;

    &lt;/LinearLayout&gt;
</code></pre>

<p>ActivityAlerts.java:</p>

<pre><code>import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.phinder.phinder.R;

public class ActivityAlerts extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_alerts);

        Button button = (Button) findViewById(R.id.test);
        button.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {

                Intent i = new Intent(getApplicationContext(),Phind.class);
                startActivity(i);
            }

        });
    }
}
</code></pre>

<p>Manifest:</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.phinder.phinder"&gt;

    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;

    &lt;application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"&gt;

        &lt;meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" /&gt;

        &lt;activity android:name=".LoginActivity"&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=".MainActivity"
            android:theme="@style/AppTheme.NoActionBar" /&gt;
        &lt;activity
            android:name=".Menu.About"
            android:theme="@style/AppTheme.NoActionBar" /&gt;
        &lt;activity
            android:name=".Menu.Alerts"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="stateHidden" /&gt;
        &lt;activity
            android:name=".Menu.Pin"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="stateHidden" /&gt;
        &lt;activity
            android:name=".Menu.Help"
            android:theme="@style/AppTheme.NoActionBar" /&gt;
        &lt;activity
            android:name=".Phind"
            android:label="@string/app_name" /&gt;
        &lt;activity
            android:name=".ActivityAlerts"
            android:label="@string/app_name"/&gt;

        &lt;activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" /&gt;
    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>I removed some of the excess code in the activity_alerts.xml to make it easier to find the button</p>

<p>Logcat starting from when I open the activity_alerts.xml and ending at when I click on the button that should take me to the phind.xml (nothing happens after that, so the report ends):</p>

<pre><code>12-18 15:03:10.704 9207-9207/com.phinder.phinder I/Timeline: Timeline: Activity_launch_request id:com.phinder.phinder time:53000744
12-18 15:03:10.749 9207-9207/com.phinder.phinder D/ViewRootImpl: #3 mView = null
12-18 15:03:10.799 9207-9207/com.phinder.phinder D/SecWifiDisplayUtil: Metadata value : none
12-18 15:03:10.799 9207-9207/com.phinder.phinder D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{e76390 I.E...... R.....ID 0,0-0,0}
12-18 15:03:10.824 9207-9261/com.phinder.phinder D/mali_winsys: new_window_surface returns 0x3000,  [1440x2560]-format:1
12-18 15:03:10.839 9207-9207/com.phinder.phinder W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
12-18 15:03:10.854 9207-9207/com.phinder.phinder D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
12-18 15:03:10.884 9207-9207/com.phinder.phinder I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@3371e53 time:53000921
12-18 15:03:10.904 9207-9207/com.phinder.phinder V/ActivityThread: updateVisibility : ActivityRecord{e144243 token=android.os.BinderProxy@62090c2 {com.phinder.phinder/com.phinder.phinder.MainActivity}} show : false
12-18 15:03:13.769 9207-9257/com.phinder.phinder I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
12-18 15:03:13.769 9207-9257/com.phinder.phinder I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
12-18 15:03:14.379 9207-9257/com.phinder.phinder I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
12-18 15:03:14.379 9207-9257/com.phinder.phinder I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
12-18 15:03:16.799 9207-9207/com.phinder.phinder D/ViewRootImpl: ViewPostImeInputStage processPointer 0
12-18 15:03:16.909 9207-9207/com.phinder.phinder D/ViewRootImpl: ViewPostImeInputStage processPointer 1
</code></pre>