Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.android.history;
- import android.os.Bundle;
- import android.app.AlertDialog;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.support.v4.app.Fragment;
- import android.view.LayoutInflater;
- import android.view.Menu;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.view.ViewGroup;
- import android.widget.Button;
- import android.widget.TextView;
- public class MainActivity extends Fragment{
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.main, container, false);
- TextView random = (TextView) view.findViewById(R.id.testbutton);
- random.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- Intent gotohistory = new Intent(getActivity(), SecondMain.class);
- startActivity(gotohistory);
- }
- });
- return (view);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement