package com.raychenon.licensedroid.sample;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.Button;

import com.raychenon.licensedroid.OpenSourceDialogFragment;

import java.util.ArrayList;

/**
 * @author Raymond Chenon
 */
public class StartActivity extends FragmentActivity {

    Button activityBtn;
    Button dialogBtn;

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

        activityBtn = (Button) findViewById(R.id.activity_button);
        dialogBtn = (Button) findViewById(R.id.dialog_button);

        activityBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                redirect();
            }
        });

        dialogBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                showDialog();
            }
        });
    }

    private void redirect(){
        startActivity(new Intent(this,OpenSourceActivity.class));
    }

    private void showDialog() {
        OpenSourceDialogFragment dialog = OpenSourceDialogFragment.newInstance(new ArrayList<>(OpenSourceData.getLicenseData()));
        dialog.show(getSupportFragmentManager(), "dialog");
    }


}

@@ -122,21 +122,22 @@
 rt.v
-4
+7
 .app.
-Fragmen
+AppCompa
 tAct
@@ -359,23 +359,24 @@
 extends 
-Fragmen
+AppCompa
 tActivit

set a title by extending AppCompatActivity