0

I'm new to mobile development and I'm making my first app using Android SDK. Unfortunately, my app stops running every time I try to run it.

Here is my code for the main.

package com.example.jayveeengracio.icsapp;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Button;
import android.view.View;
import android.content.Intent;


import static com.example.jayveeengracio.icsapp.R.id.B1;
import static com.example.jayveeengracio.icsapp.R.id.B2;
import static com.example.jayveeengracio.icsapp.R.id.B3;
import static com.example.jayveeengracio.icsapp.R.id.B4;
import static com.example.jayveeengracio.icsapp.R.id.Opp;
//import static com.example.jayveeengracio.icsapp.R.id.T1;
//import static com.example.jayveeengracio.icsapp.R.id.T2;
//import static com.example.jayveeengracio.icsapp.R.id.T3;
//import static com.example.jayveeengracio.icsapp.R.id.T4;
import static com.example.jayveeengracio.icsapp.R.id.month;
import static com.example.jayveeengracio.icsapp.R.layout.activity_main;

public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(activity_main);
    //TextView text1 = (TextView) findViewById(T1);
    //TextView text2 = (TextView) findViewById(T2);
    //TextView text3 = (TextView) findViewById(T3);
    //TextView text4 = (TextView) findViewById(T4);
    Button butt1 = (Button) findViewById(B1);
    Button butt2 = (Button) findViewById(B2);
    Button butt3 = (Button) findViewById(B3);
    Button butt4 = (Button) findViewById(B4);

    butt1.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
            EveMan mb = new EveMan("UCLA", 5, "October", 7, "00");
            Intent myIntent;
            myIntent = new Intent(MainActivity.this, MA2.class);
            TextView opp = (TextView) findViewById(Opp);
            opp.setText(mb.getOpp());
            TextView Month = (TextView) findViewById(month);
            Month.setText(mb.getMonth());
            TextView day = (TextView) findViewById(R.id.day);
            day.setText(mb.getDay());
            TextView hour = (TextView) findViewById(R.id.hour);
            hour.setText(mb.getHour());
            TextView min = (TextView) findViewById(R.id.min);
            min.setText(mb.getMin());
            startActivity(myIntent);
        }
    });
    butt2.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
            EveMan wb = new EveMan("UC Irvine", 6, "October", 7, "00");
            Intent myIntent1;
            myIntent1 = new Intent(MainActivity.this, MA2.class);
            TextView opp = (TextView) findViewById(Opp);
            opp.setText(wb.getOpp());
            TextView Month = (TextView) findViewById(month);
            Month.setText(wb.getMonth());
            TextView day = (TextView) findViewById(R.id.day);
            day.setText(wb.getDay());
            TextView hour = (TextView) findViewById(R.id.hour);
            hour.setText(wb.getHour());
            TextView min = (TextView) findViewById(R.id.min);
            min.setText(wb.getMin());
            startActivity(myIntent1);
        }
    });
    butt3.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
            EveMan mv = new EveMan("UC Davis", 10, "October", 7, "00");
            Intent myIntent2;
            myIntent2 = new Intent(MainActivity.this, MA2.class);
            TextView opp = (TextView) findViewById(Opp);
            opp.setText(mv.getOpp());
            TextView Month = (TextView) findViewById(month);
            Month.setText(mv.getMonth());
            TextView day = (TextView) findViewById(R.id.day);
            day.setText(mv.getDay());
            TextView hour = (TextView) findViewById(R.id.hour);
            hour.setText(mv.getHour());
            TextView min = (TextView) findViewById(R.id.min);
            min.setText(mv.getMin());
            startActivity(myIntent2);
        }
    });
    butt4.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
            EveMan wv = new EveMan("UC Santa Cruz", 11, "October", 7, "00");
            Intent myIntent3;
            myIntent3 = new Intent(MainActivity.this, MA2.class);
            TextView opp = (TextView) findViewById(Opp);
            opp.setText(wv.getOpp());
            TextView Month = (TextView) findViewById(month);
            Month.setText(wv.getMonth());
            TextView day = (TextView) findViewById(R.id.day);
            day.setText(wv.getDay());
            TextView hour = (TextView) findViewById(R.id.hour);
            hour.setText(wv.getHour());
            TextView min = (TextView) findViewById(R.id.min);
            min.setText(wv.getMin());
            startActivity(myIntent3);
        }
    });
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }

    return super.onOptionsItemSelected(item);
}
}

Here is my LogCat

03-17 15:47:11.435    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ Not late-enabling -Xcheck:jni (already on)
03-17 15:47:12.286    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ WaitForGcToComplete blocked for 7.189ms for cause Alloc
03-17 15:47:12.302    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ Alloc sticky concurrent mark sweep GC freed 12(368B) AllocSpace objects, 0(0B) LOS objects, 9% free, 18MB/20MB, paused 2.991ms total 14.771ms
03-17 15:47:12.318    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ Alloc partial concurrent mark sweep GC freed 25(1024B) AllocSpace objects, 0(0B) LOS objects, 18% free, 18MB/22MB, paused 1.560ms total 11.349ms
03-17 15:47:12.334    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ Alloc concurrent mark sweep GC freed 15(12KB) AllocSpace objects, 0(0B) LOS objects, 18% free, 18MB/22MB, paused 1.600ms total 12.087ms
03-17 15:47:12.337    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ Forcing collection of SoftReferences for 180MB allocation
03-17 15:47:12.355    2301-2301/com.example.jayveeengracio.icsapp I/art﹕ Alloc concurrent mark sweep GC freed 11(344B) AllocSpace objects, 0(0B) LOS objects, 18% free, 18MB/22MB, paused 2.024ms total 17.136ms
03-17 15:47:12.359    2301-2301/com.example.jayveeengracio.icsapp E/art﹕ Throwing OutOfMemoryError "Failed to allocate a 189007516 byte allocation with 4194304 free bytes and 45MB until OOM"
03-17 15:47:12.359    2301-2301/com.example.jayveeengracio.icsapp D/skia﹕ --- allocation failed for scaled bitmap
03-17 15:47:12.360    2301-2301/com.example.jayveeengracio.icsapp D/AndroidRuntime﹕ Shutting down VM
03-17 15:47:12.361    2301-2301/com.example.jayveeengracio.icsapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.example.jayveeengracio.icsapp, PID: 2301
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jayveeengracio.icsapp/com.example.jayveeengracio.icsapp.MainActivity}: android.view.InflateException: Binary XML file line #62: Error inflating class android.widget.Button
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: android.view.InflateException: Binary XML file line #62: Error inflating class android.widget.Button
            at android.view.LayoutInflater.createView(LayoutInflater.java:633)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
            at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
            at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:240)
            at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
            at com.example.jayveeengracio.icsapp.MainActivity.onCreate(MainActivity.java:30)
            at android.app.Activity.performCreate(Activity.java:5933)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: java.lang.reflect.InvocationTargetException
            at java.lang.reflect.Constructor.newInstance(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
            at android.view.LayoutInflater.createView(LayoutInflater.java:607)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
            at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
            at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:240)
            at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
            at com.example.jayveeengracio.icsapp.MainActivity.onCreate(MainActivity.java:30)
            at android.app.Activity.performCreate(Activity.java:5933)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: java.lang.OutOfMemoryError: Failed to allocate a 189007516 byte allocation with 4194304 free bytes and 45MB until OOM
            at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
            at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
            at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
            at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
            at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:973)
            at android.content.res.Resources.loadDrawableForCookie(Resources.java:2423)
            at android.content.res.Resources.loadDrawable(Resources.java:2330)
            at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
            at android.view.View.<init>(View.java:3730)
            at android.widget.TextView.<init>(TextView.java:634)
            at android.widget.Button.<init>(Button.java:111)
            at android.widget.Button.<init>(Button.java:107)
            at android.widget.Button.<init>(Button.java:103)
            at java.lang.reflect.Constructor.newInstance(Native Method)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
            at android.view.LayoutInflater.createView(LayoutInflater.java:607)
            at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
            at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
            at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:240)
            at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
            at com.example.jayveeengracio.icsapp.MainActivity.onCreate(MainActivity.java:30)
            at android.app.Activity.performCreate(Activity.java:5933)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
 03-17 15:52:12.722    2301-2301/com.example.jayveeengracio.icsapp I/Process﹕         Sending signal. PID: 2301 SIG: 9

My manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jayveeengracio.icsapp" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MA2"
            android:label="@string/title_activity_ma2" >
            <intent-filter>
                <action android:name="com.example.jayveeengracio.icsapp.MA2" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

</manifest>

My MA2.java

package com.example.jayveeengracio.icsapp;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import static com.example.jayveeengracio.icsapp.R.id.be;
import static com.example.jayveeengracio.icsapp.R.layout.events;


public class MA2 extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(events);
        Button tickets = (Button) findViewById(be);

        tickets.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                TextView tex = (TextView) findViewById(R.id.SN);
                tex.setText("YES");
            }
        });


    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_ma2, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

activity_main.xml

<RelativeLayout 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:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
    android:background="@drawable/gobows"
    android:id="@+id/Page1">

    <TextView android:text="@string/mbball"
        android:layout_width="400dp"
        android:layout_height="50dp"
        android:id="@+id/T1"
        android:layout_marginTop="150dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:background="@drawable/textbox"
        android:textSize="30sp"
        android:textIsSelectable="false"
        android:typeface="serif" />

    <TextView
        android:text="@string/mvball"
        android:layout_width="400dp"
        android:layout_height="50dp"
        android:id="@+id/T2"
        android:layout_marginTop="40dp"
        android:background="@drawable/textbox"
        android:textSize="30sp"
        android:textIsSelectable="false"
        android:typeface="serif"
        android:layout_below="@+id/T1"
        android:layout_centerHorizontal="true" />

    <TextView
        android:text="@string/wbball"
        android:layout_width="400dp"
        android:layout_height="50dp"
        android:id="@+id/T3"
        android:layout_marginTop="40dp"
        android:background="@drawable/textbox"
        android:textSize="30sp"
        android:textIsSelectable="false"
        android:typeface="serif"
        android:layout_below="@+id/T2"
        android:layout_centerHorizontal="true" />

    <TextView
        android:text="@string/wvball"
        android:layout_width="400dp"
        android:layout_height="50dp"
        android:id="@+id/T4"
        android:layout_marginTop="40dp"
        android:background="@drawable/textbox"
        android:textSize="30sp"
        android:textIsSelectable="false"
        android:typeface="serif"
        android:layout_below="@+id/T3"
        android:layout_centerHorizontal="true" />

    <Button
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:text="@string/tix"
        android:id="@+id/B1"
        android:layout_alignBottom="@+id/T1"
        android:layout_alignRight="@+id/T1"
        android:layout_alignEnd="@+id/T1"
        android:background="@drawable/bball"
        android:textSize="25sp"
        android:textColor="#ffffffff" />

    <Button
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:text="@string/tix"
        android:id="@+id/B2"
        android:background="@drawable/bball"
        android:textSize="25sp"
        android:textColor="#ffffffff"
        android:layout_alignBottom="@+id/T2"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <Button
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:text="@string/tix"
        android:id="@+id/B3"
        android:background="@drawable/vball"
        android:textSize="25sp"
        android:textColor="#000000"
        android:layout_alignBottom="@+id/T3"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <Button
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:text="@string/tix"
        android:id="@+id/B4"
        android:background="@drawable/vball"
        android:textSize="25sp"
        android:textColor="#000000"
        android:layout_alignBottom="@+id/T4"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

</RelativeLayout>

events.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:id="@+id/page2"
    android:background="@drawable/gobows">

    <ImageView
        android:layout_width="400dp"
        android:layout_height="60dp"
        android:id="@+id/iv"
        android:layout_marginTop="145dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:background="#ff000000"
        android:contentDescription="@string/black" />

    <TextView
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:text="@string/opp"
        android:id="@+id/Opp"
        android:layout_marginTop="150dp"
        android:layout_marginRight="25dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:background="#ff00e500"
        android:textSize="25sp"
        android:textIsSelectable="true"
        android:textColor="#ff000000" />

    <TextView
        android:layout_width="80dp"
        android:layout_height="20dp"
        android:text="@string/mon"
        android:id="@+id/month"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="150dp"
        android:layout_marginBottom="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:background="#ff00e500"
        android:textColor="#ff000000" />

    <TextView
        android:layout_width="80dp"
        android:layout_height="20dp"
        android:text="@string/day"
        android:id="@+id/day"
        android:background="#ff00e500"
        android:layout_below="@+id/month"
        android:layout_alignLeft="@+id/month"
        android:layout_alignStart="@+id/month"
        android:textColor="#ff000000" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/getix"
        android:id="@+id/be"
        android:layout_alignTop="@+id/Opp"
        android:layout_alignRight="@+id/Opp"
        android:layout_alignEnd="@+id/Opp"
        android:background="#ff0f330f"
        android:textColor="#ff70ff70" />

    <TextView
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="@string/hour"
        android:id="@+id/hour"
        android:textColor="#000000"
        android:layout_alignBottom="@+id/Opp"
        android:layout_alignLeft="@+id/Opp"
        android:layout_alignStart="@+id/Opp"
        android:background="#ffffffff" />

    <TextView
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="@string/min"
        android:id="@+id/min"
        android:textColor="#000000"
        android:layout_alignBottom="@+id/Opp"
        android:layout_toRightOf="@+id/hour"
        android:layout_toEndOf="@+id/hour"
        android:background="#ffffffff" />

    <TextView
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:text="@string/sn"
        android:textSize="70sp"
        android:id="@+id/SN"
        android:textColor="#000000"
        android:layout_marginTop="300dp"
        android:layout_marginLeft="50dp"
        android:background="#ffffffff"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="80dp"
        android:text="@string/number"
        android:textSize="70sp"
        android:id="@+id/number"
        android:textColor="#000000"
        android:layout_marginTop="300dp"
        android:layout_marginLeft="200dp"
        android:background="#ffffffff"
        />

</RelativeLayout>

Any suggestions helps, thank you!

  • show your xml line 62 – Randyka Yudhistira Mar 18 '15 at 02:08
  • show your codes of `MA2.java`. Log shows `MA2.class` is not loaded right way. – SilentKnight Mar 18 '15 at 02:14
  • I wouldn't comment out imports. If you no longer use them let the ide clean it up for you. What will likely happen is you'll use them again, they'll be auto-inserted then you'll have dups. – ChiefTwoPencils Mar 18 '15 at 02:17
  • What happens if you remove the static import on the button's id and use `R.id.be`? BTW, I've never seen it done that way; not that it can't be, just never seen it. – ChiefTwoPencils Mar 18 '15 at 02:19
  • I think there is something wrong in your layout xml file. please show your layout file where you have your views like button – RajSharma Mar 18 '15 at 02:20
  • It looks like `B1` in `Button butt1 = (Button) findViewById(B1);` is a variable that's not assigned to a resource. Try replacing all of your findViewById's with `Button butt1 = (Button) findViewById(R.id.B1);` etc. – DevJem Mar 18 '15 at 02:44
  • 1
    Have you set some ridiculously large image in your xml, as a background, perhaps? You seem to be allocating quite a lot of memory ... – Harry Silver Mar 18 '15 at 02:47

1 Answers1

0

You have an OutOfMemoryError:

Throwing OutOfMemoryError "Failed to allocate a 189007516 byte allocation with 4194304 free bytes and 45MB until OOM"

Which seems to be caused by some code in your main xml file:

 Caused by: android.view.InflateException: Binary XML file line #62: Error inflating class android.widget.Button

This leads me to suggest, that the error is caused by trying to load huge image files. You might want to ensure that your images don't take up more than a few MB.

To test this, you could remove all images from your xml, and take a look if the error persists, or not.

Harry Silver
  • 397
  • 2
  • 11