My Problem: application not starting.

```
Caused by: java.lang.NullPointerException: Attempt to invoke virtual
method 'void
android.view.View.setOnClickListener(android.view.View$OnClickListener)'
on a null object reference
        at info.androidhive.materialtabs.activity.MainActivity.onCreate(MainActivity.java:25)

Main activity line 25 , rellay_timeline.setOnClickListener(new
View.OnClickListener() {

```

**MainActivity.java** class:

```
    public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    RelativeLayout rellay_timeline;
    private Toolbar toolbar;
    private Button btnSimpleTabs, btnScrollableTabs, btnIconTextTabs, btnIconTabs, btnCustomIconTextTabs;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        rellay_timeline = findViewById(R.id.rellay_timeline999);

        rellay_timeline.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, Activity_Timeline.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
            }
        });

        toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        btnSimpleTabs = (Button) findViewById(R.id.btnSimpleTabs);
        btnScrollableTabs = (Button) findViewById(R.id.btnScrollableTabs);
        btnIconTextTabs = (Button) findViewById(R.id.btnIconTextTabs);
        btnIconTabs = (Button) findViewById(R.id.btnIconTabs);
        btnCustomIconTextTabs = (Button) findViewById(R.id.btnCustomIconTabs);

        btnSimpleTabs.setOnClickListener(this);
        btnScrollableTabs.setOnClickListener(this);
        btnIconTextTabs.setOnClickListener(this);
        btnIconTabs.setOnClickListener(this);
        btnCustomIconTextTabs.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btnSimpleTabs:
                startActivity(new Intent(MainActivity.this, SimpleTabsActivity.class));
                break;
            case R.id.btnScrollableTabs:
                startActivity(new Intent(MainActivity.this, ScrollableTabsActivity.class));
                break;
            case R.id.btnIconTextTabs:
                startActivity(new Intent(MainActivity.this, IconTextTabsActivity.class));
                break;
            case R.id.btnIconTabs:
                startActivity(new Intent(MainActivity.this, IconTabsActivity.class));
                break;
            case R.id.btnCustomIconTabs:
                startActivity(new Intent(MainActivity.this, CustomViewIconTextTabsActivity.class));
                break;
        }
    }
}

```

Below is `xml` file :

```
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.androidhive.materialtabs.activity.ScrollableTabsActivity">
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="2dp"
        android:layout_marginLeft="1dp"
        android:layout_marginRight="1dp"
        android:layout_marginTop="2dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_marginTop="372dp"
            android:orientation="horizontal"
            android:weightSum="3">

            <RelativeLayout
                android:id="@+id/rellay_timeline999"
                android:layout_width="0dp"
                android:layout_height="120dp"
                android:layout_margin="2dp"
                android:layout_weight="1"
                android:background="@color/colorBitterSweet"
                android:clickable="true">

                <ImageView
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="25dp"
                    android:gravity="center_vertical"
                    android:src="@drawable/ic_icon_archary"
                    android:tint="@color/colorWhite" />

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentStart="true"
                    android:background="@color/colorBitterSweetDark"
                    android:padding="8dp"
                    android:text="Stok Transferi"
                    android:textAlignment="center"
                    android:textColor="@color/colorWhite"
                    android:textSize="14sp" />

            </RelativeLayout>

```

activity\_timeline

```
public class Activity_Timeline extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);
}
}

```