SHOW:
|
|
- or go back to the newest paste.
1 | package com.android.history; | |
2 | ||
3 | import android.os.Bundle; | |
4 | import android.app.AlertDialog; | |
5 | import android.content.DialogInterface; | |
6 | import android.content.Intent; | |
7 | import android.support.v4.app.Fragment; | |
8 | import android.view.LayoutInflater; | |
9 | import android.view.Menu; | |
10 | import android.view.View; | |
11 | import android.view.View.OnClickListener; | |
12 | import android.view.ViewGroup; | |
13 | import android.widget.Button; | |
14 | import android.widget.TextView; | |
15 | ||
16 | public class MainActivity extends Fragment{ | |
17 | ||
18 | @Override | |
19 | public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
20 | Bundle savedInstanceState) { | |
21 | View view = inflater.inflate(R.layout.main, container, false); | |
22 | ||
23 | ||
24 | TextView random = (TextView) view.findViewById(R.id.testbutton); | |
25 | random.setOnClickListener(new OnClickListener() { | |
26 | public void onClick(View v) { | |
27 | Intent gotohistory = new Intent(getActivity(), SecondMain.class); | |
28 | startActivity(gotohistory); | |
29 | ||
30 | } | |
31 | }); | |
32 | ||
33 | - | return view; |
33 | + | return (view); |
34 | } |