I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml

Here is the code snippet:

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:background="@drawable/splash_background"
 android:layout_height="match_parent"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context=".MainActivity" >

<Button
    android:id="@+id/Home"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_marginRight="43dp"
    android:onClick="home"
    android:text="Home" />

</RelativeLayout>

```

And then, I have my home.xml. I want the button to open up home.xml. How can i do this?
I don't know any java and I am new to android development. 

Here is my home.xml below:

```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:background="@drawable/app_bg"
    android:layout_height="match_parent"
    android:orientation="vertical" >

</LinearLayout>

```

And below is my AndroidManifest.xml:

```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.example.idozer"
 android:versionCode="1"
 android:versionName="1.0" >

 <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

 <application
    android:allowBackup="false"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.idozer.SplashActivity"
        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="com.example.idozer.MainActivity"
        android:label="@string/app_name" >
    </activity>
</application>
</manifest>

```

And that's all I have. Please, if you reply, tell me where to add the code such as the directory or between code snippets.
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
create another class goto your project right click and click class and create Home. 
In that Home class file extends activity and add code like this 

```
public class Home extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.home);
  }
}

```

in **splash activity class** add this line

```
Intent intent = new Intent(SplashActivity.this,Home.class);
startActivity(intent);

```

add Home activity class in your android manifest file 

```
<activity android:name="com.example.idozer.Home"
    android:label="@string/app_name" >
</activity>

```
I will give you just a little bit to get you started as this answer may help others that are having trouble with using `onClick()` this way but you really need to learn Java and go through the **[Android Docs](http://developer.android.com/index.html)** so you can ask better questions

You need to read [Here](http://developer.android.com/reference/android/app/Activity.html) about `Actviities` and how to create them. Then in your code you will have a function

```
 public void home(View v)  //the name of this function comes from where you declared in your manifest `android:onClick="home"
{
     Intent intent (MainActivity.this, HomeActivity.class); //MainActivity is the name of current activity and HomeActivity is the name of the activity you want to start
     can add intent extras/flags/categories here
     startActivity(intent);
}

```

You also need to add the `HomeActivity` in your `manifest` as you have for the other `Activities`.

But you really need to go through the docs and do some tutorials to get an idea of how the Android framework operates and you need to learn Java to make your life a whole lot easier. Besides the previous two links I have given, also see [this post](https://stackoverflow.com/questions/15059351/using-nested-interfaces-for-communication-between-two-classes-in-java-android/15059793#15059793) about click events as there are different ways to use `onClick()`

I hope this is enough to get you started and I really hope you go through the docs to get a better understanding of what you are doing. Good luck to you!

Another important link to get started

[Intents](http://developer.android.com/reference/android/content/Intent.html)