Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 12th, 2012  |  syntax: Java  |  size: 1.00 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);
  34.     }