• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Error in New activity creation.

BASVIN

Lurker
Hello to all
I am a beginner in android & programming. I developed an app by reading manuals & procedures. I have added a new activity in my app, after that it is not working. I know some error exists in the activity java code. Please help me to solve this error. Thanks in advance.

Code:
activity.java file content.
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
/**
* Created by Vinoth on 12/29/2016.
*/
public class MainActivity1 extends AppCompatActivity{
    [USER=1021285]@override[/USER]
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main1);

    }
}

Layout.xml file content:

<?xml version="1.0" encoding="utf-8"?>
<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:eek:rientation="vertical"
    android:background="@android:color/white"
    android:padding="8dp">

  <TextView
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight="8"
      android:id="@+id/from_thammampattiid"
      android:text="[USER=696546]@String[/USER]/app_name"
      android:textColor="@android:color/white"
      android:textSize="48sp"
      android:background="@android:color/black"
      android:layout_gravity="center"
      android:gravity="center_vertical|center_horizontal"
      android:layout_margin="8dp"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="2"
        android:id="@+id/enterapp"
        android:text=">"
        android:textColor="@android:color/white"
        android:textSize="80sp"
        android:background="@android:color/black"
        android:layout_gravity="center"
        android:gravity="center_vertical|center_horizontal"
        android:layout_margin="8dp"/>
 
</LinearLayout>


manifest file content:

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

    <application
        android:allowBackup="true"
        android:icon="[USER=22138]@Mipmap[/USER]/ic_launcher"
        android:label="[USER=696546]@String[/USER]/app_name"
        android:supportsRtl="true"
        android:theme="[USER=19691]@Style[/USER]/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
       
        <activity android:name=".MainActivity1"
            android:label="[USER=696546]@String[/USER]/app_name">

        </activity>
        <activity android:name=".MainActivity2"
            android:label="[USER=696546]@String[/USER]/app_name">
</activity>

        <activity android:name=".MainActivity3"
            android:label="[USER=696546]@String[/USER]/app_name">

        </activity>
</application>

</manifest>
 
Last edited by a moderator:
Welcome to AF, @BASVIN.

I've moved your thread over here to our Application Development area for you.

You might want to have a peek at this thread:


for some tips about what others might need to see to best help you out (your error stack trace, for example, etc.).

I've also added "code" tags around your code so it will display better.

Cheers!
 
If there's an error which caused the app to crash, you need to post the output from the Logcat, including the stack trace.
 
Back
Top Bottom