Q:

Link to Facebook doesn't work

I'm trying to a link to the Facebook application. If it doesn't exist, it should go to Facebook in the browser.
The problem is, when I click on the button that goes there it gives me this error:

Unfortunately, A has stopped

I couldn't figure what to do with @SuppressWarnings("null") and uri = null.
Help.
package com.example.a;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity {

    Button dadclink;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        addListenerOnButton();
    }

    public void addListenerOnButton() {
        dadclink = (Button) findViewById(R.id.dadclink);

        dadclink.setOnClickListener(new OnClickListener() {
            @SuppressWarnings("null")
            @Override
            public void onClick(View arg0) {
                String uri = null;
                if (!uri.contains("https://www.facebook.com/")) {
                    String natgeo = "natgeo";
                    String uri1 = "fb://Page/" + natgeo;
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri
                            .parse(uri1));
                    startActivity(intent);
                } else {
                    String natgeo = "natgeo";
                    String uri1 = "https://www.facebook.com/" + natgeo;
                    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
                    startActivity(i);
                } 
            } 
        }); 

    }
} 

Edited
package com.example.a;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity {

    Button dadclink;
    protected String uri;
    protected String uri1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        addListenerOnButton();
    }

    public void addListenerOnButton() {
        dadclink = (Button) findViewById(R.id.dadclink);

        dadclink.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {

                if (!uri.contains("https://www.facebook.com/")) {
                    String natgeo = "natgeo";
                    String uri = "fb://Page/" + natgeo;
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri
                            .parse(uri));
                    startActivity(intent);
                } else {
                    String natgeo = "natgeo";
                    String uri1 = "https://www.facebook.com/" + natgeo;
                    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
                    startActivity(i);
                } 
            } 
        }); 

    }
} 

Edited again
public void addListenerOnButton() {
        dadclink = (Button) findViewById(R.id.dadclink);

        dadclink.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                String uri = "";
                if (!uri.contains("https://www.facebook.com/")) {
                    String natgeo = "natgeo";
                    String uri1 = "fb://Page/" + natgeo;
                    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
                    startActivity(intent);
                } else {
                    String natgeo = "natgeo";
                    String uri1 = "https://www.facebook.com/" + natgeo;
                    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
                    startActivity(i);
                } 
            } 
        }); 

A:

It seems as though you aren't really paying attention to what you are doing. You currently have this:
dadclink.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View arg0) {

        if (!uri.contains("https://www.facebook.com/")) {
            String natgeo = "natgeo";
            String uri = "fb://Page/" + natgeo;
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
            startActivity(intent);
        } else {
            String natgeo = "natgeo";
            String uri1 = "https://www.facebook.com/" + natgeo;
            Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
            startActivity(i);
        } 
    } 
}); 

But you have set your uri string as
protected String uri;

This means that the first time you click, since you haven't set your uri anywhere, you will hit this line
if(!uri.contains("https://www.facebook.com/")){

and you will be trying to do null.contains("https://www.facebook.com/");. But obviously null doesn't support any sort of function calls, in other words null.contains() will cause your app to crash with a NPE.
EDIT
Just because you are getting close but need some help wrapping up, this should be your onClick method
    @Override
    public void onClick(View arg0) {
        String uri = "https://www.facebook.com/natgeo";
        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
        startActivity(i);
    } 

It is as simple as that, you are way over-complicating things.

