Exemplo n.º 1
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   final ActionBar actionBar = getSherlockActivity().getSupportActionBar();
   actionBar.setTitle("Nested fragment");
   actionBar.setSubtitle(String.valueOf(mTimestamp));
 }
Exemplo n.º 2
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // init loader
    getLoaderManager().initLoader(0, null, this);
  }
Exemplo n.º 3
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    setRetainInstance(true);
    deliverModel();
  }
Exemplo n.º 4
0
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		
		// Get our GUI elements.
		searchButton = (Button)getSherlockActivity().findViewById(R.id.button_search);
		searchEdit = (EditText)getSherlockActivity().findViewById(R.id.edit_search);
		
		searchEdit.setTextColor(0xfff0641e);

		searchProgress = (ProgressBar)getSherlockActivity().findViewById(R.id.progress_search);
		
		// Create a listener for keyboard "enter" button.
		OnEditorActionListener listener = new OnEditorActionListener() {
		    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
		        if (actionId == EditorInfo.IME_ACTION_SEARCH) {
		        	// Simulate click on the search button.
		            searchButton.performClick();
		            return true;
		        }
		        return false;
		    }
		};
		// Add our newly created listener to the text field.
		searchEdit.setOnEditorActionListener(listener);
	}
Exemplo n.º 5
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // get settings
    getSortAndFilterSettings();

    // prepare view adapter
    int resIdStar =
        Utils.resolveAttributeToResourceId(getSherlockActivity().getTheme(), R.attr.drawableStar);
    int resIdStarZero =
        Utils.resolveAttributeToResourceId(getSherlockActivity().getTheme(), R.attr.drawableStar0);
    mAdapter = new SlowAdapter(getActivity(), null, 0, resIdStar, resIdStarZero, this);

    // setup grid view
    mGrid = (GridView) getView().findViewById(R.id.gridViewShows);
    mGrid.setAdapter(mAdapter);
    mGrid.setOnItemClickListener(this);
    registerForContextMenu(mGrid);

    // start loading data
    getLoaderManager().initLoader(LOADER_ID, null, this);

    // listen for some settings changes
    PreferenceManager.getDefaultSharedPreferences(getActivity())
        .registerOnSharedPreferenceChangeListener(mPrefsListener);

    setHasOptionsMenu(true);
  }
Exemplo n.º 6
0
 /** {@inheritDoc} */
 @Override
 public void onActivityCreated(final Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   // Enable the options menu
   setHasOptionsMenu(true);
   // Start the loader
   getLoaderManager().initLoader(LOADER, null, this);
 }
Exemplo n.º 7
0
 /** {@inheritDoc} */
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   if (mAccount != null) {
     mStorageManager =
         new FileDataStorageManager(
             mAccount, getActivity().getApplicationContext().getContentResolver());
   }
 }
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    if (m_viewModel.getCurrentTab() != null
        && m_viewModel.getCurrentTab().equals(StringUtility.TAB_PROFILE)) {
      reloadProfile();
    }
  }
  /* (non-Javadoc)
   * @see android.support.v4.app.Fragment#onActivityCreated(android.os.Bundle)
   */
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    usersAdapter = new UserListAdapter(getActivity(), channelUsersList, null);
    channelUsersList.setAdapter(usersAdapter);
    registerForContextMenu(channelUsersList);
    channelUsersList.setEmptyView(noUsersText);
  }
Exemplo n.º 10
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    try {
      loadUserInfo();
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Exemplo n.º 11
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    if (!((FragmentListener) a).getHasSeenFirstPage()) {
      initButtons();
      ((FragmentListener) a).setHasSeenFirstPage(true);
    }

    updateUi();
  }
Exemplo n.º 12
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if (PagerActivity.class.isInstance(getActivity())) {
      QuranPageWorker worker = ((PagerActivity) getActivity()).getQuranPageWorker();
      worker.loadPage(mPageNumber, mImageView);

      if (mPageBoundsRect == null) {
        new QueryPageCoordsTask().execute();
      }
    }
  }
Exemplo n.º 13
0
 @TargetApi(Build.VERSION_CODES.HONEYCOMB)
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   if (passwordList == null) {
     if (thread.getStatus() == Status.FINISHED || thread.getStatus() == Status.RUNNING)
       thread = new KeygenThread(wifiNetwork);
     if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
       thread.execute();
     } else {
       thread.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
     }
   }
 }
Exemplo n.º 14
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   mInterface = ((YAMMPApplication) getSherlockActivity().getApplication()).getServiceInterface();
   super.onActivityCreated(savedInstanceState);
   mSearchFragment = new LyricsSearchFragment();
   getFragmentManager().addOnBackStackChangedListener(this);
   View view = getView();
   mLyricsScrollView = (TextScrollView) view.findViewById(R.id.lyrics_scroll);
   mLyricsScrollView.setContentGravity(Gravity.CENTER_HORIZONTAL);
   mLyricsScrollView.setLineSelectedListener(this);
   mLyricsEmptyView = (Button) view.findViewById(R.id.lyrics_empty);
   mLyricsEmptyView.setOnClickListener(this);
   mLyricsSearchLayout = (LinearLayout) view.findViewById(R.id.search_lyrics);
   mInterface.addLyricsStateListener(this);
 }
Exemplo n.º 15
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    MessageReference messageReference;
    if (savedInstanceState != null) {
      mPgpData = (PgpData) savedInstanceState.get(STATE_PGP_DATA);
      messageReference = (MessageReference) savedInstanceState.get(STATE_MESSAGE_REFERENCE);
    } else {
      Bundle args = getArguments();
      messageReference = (MessageReference) args.getParcelable(ARG_REFERENCE);
    }

    displayMessage(messageReference, (mPgpData == null));
  }
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getSherlockActivity().getSupportActionBar().setDisplayHomeAsUpEnabled(false);
    setHasOptionsMenu(true);

    ViewPager mPager = (ViewPager) getActivity().findViewById(R.id.pager);

    MenuAdapter adapter = new MenuAdapter();
    mPager.setAdapter(adapter);

    CirclePageIndicator indicator =
        (CirclePageIndicator) getActivity().findViewById(R.id.indicator);
    indicator.setViewPager(mPager);
  }
Exemplo n.º 17
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // set list adapter
    mAdapter = new TmdbMoviesAdapter(getActivity());

    // basic setup of grid view
    mGrid = (GridView) getView().findViewById(android.R.id.list);
    mGrid.setOnItemClickListener(this);
    View emptyView = getView().findViewById(android.R.id.empty);
    if (emptyView != null) {
      mGrid.setEmptyView(emptyView);
    }

    // restore an existing adapter
    if (mAdapter != null) {
      mGrid.setAdapter(mAdapter);
    }

    onListLoad(true);
  }
Exemplo n.º 18
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   ((MainActivity) getActivity()).updateRefreshStatus(mSyncing);
 }
Exemplo n.º 19
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(
        savedInstanceState); // To change body of overridden methods use File | Settings | File
                             // Templates.
    buckets = (ListView) view.findViewById(R.id.buckets_listview);
    // buckets.setBackgroundColor(Color.TRANSPARENT);
    // buckets.setCacheColorHint(Color.TRANSPARENT);

    ActionBar actionBar = getSherlockActivity().getSupportActionBar();
    actionBar.setTitle("Albums");

    imageLoader = ImageLoader.getInstance();

    displayImageOptions =
        new DisplayImageOptions.Builder()
            .showStubImage(R.drawable.white)
            // .cacheInMemory(true)
            // .cacheOnDisc(true)
            // .bitmapConfig(Bitmap.Config.RGB_565)
            .build();

    HashSet<String> bucketSet = new HashSet<String>();
    HashSet<String> imageSet = new HashSet<String>();

    HashMap<String, String> imagesHash = new HashMap<String, String>();

    ArrayList<String> bucketList = new ArrayList<String>();
    ArrayList<String> imageList = new ArrayList<String>();

    String[] projection =
        new String[] {
          MediaStore.Images.Media._ID,
          MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
          MediaStore.Images.Media.DATA,
          MediaStore.Images.Media.DATE_TAKEN
        };

    Uri images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;

    Cursor cur =
        view.getContext()
            .getContentResolver()
            .query(images, projection, "", null, MediaStore.Images.Media.DATE_ADDED + " DESC");

    // come up with distinct bucket names
    if (cur.moveToFirst()) {
      String bucket;
      String imagePath;

      do {
        bucket = cur.getString(cur.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME));
        if (!bucketSet.contains(bucket)) {

          bucketSet.add(bucket);
          // add the current image
          imagePath = cur.getString(cur.getColumnIndex(MediaStore.Images.Media.DATA));
          imagesHash.put(bucket, imagePath);
        }
      } while (cur.moveToNext());
    }

    bucketList.addAll(bucketSet);
    // imageList.addAll(imageSet);

    Log.d("Postal", bucketList.toString());
    Log.d("Postal", imageList.toString());

    cur.close();

    ImageBucketsAdapter adapter = new ImageBucketsAdapter(getActivity(), bucketList, imagesHash);

    // ArrayAdapter adapter = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1,
    // bucketList);

    buckets.setAdapter(adapter);

    buckets.setOnItemClickListener(
        new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            String selected = view.getTag().toString();
            listener.onBucketSelected(selected);
          }
        });
  }
Exemplo n.º 20
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
 }
Exemplo n.º 21
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   new ProvideNoticeContent().execute(getActivity().getIntent().getData());
 }
  // Starts when the MainFragment is launched
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    /*
     * This part does two things
     * First - It counts the number of items and displays them
     * Second - It displays the text in the "" which is a brief description of that item
     * Removing any of these will remove that item but be sure to edit ALL the cases below or your list
     * won't line up properly
     */

    /**
     * * NOTE: in order to have different views on tablet vs phones, I added an if/else statement to
     * this * section. Be sure to remove BOTH parts to remove it from phones and tablets. Failure to
     * remove both * parts will result in the app functioning differently on phones and tablets.
     */

    /*
     * Sets the Title and description text for each GridView item
     * Check res/values/strings.xml to change text to whatever you want each GridView to say
     */
    boolean tabletSize = getResources().getBoolean(R.bool.isTablet);
    if (tabletSize) {
      gridView = (ScrollGridView) getView().findViewById(R.id.grid);
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_app),
              getResources().getString(R.string.desc_oss),
              0));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_new_icons),
              getResources().getString(R.string.desc_new_icons),
              1));
      listOfStuff.remove(
          new AdapterItem(
              getResources().getString(R.string.title_info),
              getResources().getString(R.string.desc_info),
              2));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_apply),
              getResources().getString(R.string.desc_apply),
              3));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_walls),
              getResources().getString(R.string.desc_walls),
              4));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_community),
              getResources().getString(R.string.desc_community),
              5));

    } else {
      gridView = (ScrollGridView) getView().findViewById(R.id.grid);
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_app),
              getResources().getString(R.string.desc_oss),
              0));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_new_icons),
              getResources().getString(R.string.desc_new_icons),
              1));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_info),
              getResources().getString(R.string.desc_info),
              2));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_apply),
              getResources().getString(R.string.desc_apply),
              3));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_walls),
              getResources().getString(R.string.desc_walls),
              4));
      listOfStuff.add(
          new AdapterItem(
              getResources().getString(R.string.title_community),
              getResources().getString(R.string.desc_community),
              5));
    }

    /**
     * * NOTE: in order to have different views on tablet vs phones, I added an if/else statement to
     * this * section. Be sure to remove both parts to remove it from phones and tablets. Failure to
     * remove both * parts will result in the app functioning differently on phones and tablets.
     */
    MainAdapter adapter = new MainAdapter(getActivity(), listOfStuff);

    gridView.setAdapter(adapter);
    gridView.setExpanded(true);
    gridView.setOnItemClickListener(
        new OnItemClickListener() {
          public void onItemClick(AdapterView<?> parent, View v, int position, long id) {

            @SuppressWarnings("unused")
            MainFragment gridContentT = null;

            boolean tabletSize = getResources().getBoolean(R.bool.isTablet);
            if (tabletSize) { // for tablets

              switch (position) {
                case 0:
                  /**
                   * * This checks if MY OSS app is installed. You can remove this case * statement
                   * completely or add your own app to check against or leave * it and let it check
                   * for MY app :D * If it is installed, the app will open when you press the list
                   * item * If it is NOT installed, it will open up the play store to download it *
                   * Change line 136 with the play store link for your own app if you're * using
                   * this feature!
                   */
                  if (isPackageExists("app.the1dynasty.oss")) {
                    Intent oss = new Intent("android.intent.action.MAIN");
                    oss.setComponent(
                        ComponentName.unflattenFromString(
                            "app.the1dynasty.oss/app.activities.MainActivity"));
                    oss.addCategory("android.intent.category.LAUNCHER");
                    startActivity(oss);
                  } else {
                    Intent oss =
                        new Intent(Intent.ACTION_VIEW)
                            .setData(Uri.parse("market://details?id=app.the1dynasty.oss"));
                    startActivity(oss);
                  }
                  break;
                case 1:
                  Intent requestIcons = new Intent(getSherlockActivity(), NewIconsMain.class);
                  startActivity(requestIcons);
                  break;
                case 2:
                  Intent launcher = new Intent(getSherlockActivity(), LauncherMain.class);
                  startActivity(launcher);
                  break;
                case 3:
                  Intent wall = new Intent(getSherlockActivity(), Wallpaper.class);
                  startActivity(wall);
                  break;
                case 4:
                  /**
                   * * This launches my community on G+ * Please leave this link in here for others
                   * to join. Thank You!
                   */
                  Intent gpCommunity =
                      new Intent(Intent.ACTION_VIEW).setData(Uri.parse("http://bit.ly/14F6Eez"));
                  startActivity(gpCommunity);
                  break;
              }
            } else { // for phones
              switch (position) {
                case 0:
                  /**
                   * * This checks if MY OSS app is installed. You can remove this * section
                   * completely or Add your own app to check against or leave * it and let it check
                   * for MY app :D * If it is installed, the app will open when you press the list
                   * item * If it is NOT installed, it will open up the play store to download it *
                   * Change line 195 with the play store link for your own app if you're * using
                   * this feature!
                   */
                  if (isPackageExists("app.the1dynasty.oss")) {
                    Intent oss = new Intent("android.intent.action.MAIN");
                    oss.setComponent(
                        ComponentName.unflattenFromString(
                            "app.the1dynasty.oss/app.activities.MainActivity"));
                    oss.addCategory("android.intent.category.LAUNCHER");
                    startActivity(oss);
                  } else {
                    Intent oss =
                        new Intent(Intent.ACTION_VIEW)
                            .setData(Uri.parse("market://details?id=app.the1dynasty.oss"));
                    startActivity(oss);
                  }
                  break;
                case 1:
                  Intent requestIcons = new Intent(getSherlockActivity(), NewIconsMain.class);
                  startActivity(requestIcons);
                  break;
                case 2:
                  Intent aboutTheme = new Intent(getSherlockActivity(), AboutThemeActivity.class);
                  startActivity(aboutTheme);
                  break;
                case 3:
                  Intent launcher = new Intent(getSherlockActivity(), LauncherMain.class);
                  startActivity(launcher);
                  break;
                case 4:
                  Intent wall = new Intent(getSherlockActivity(), Wallpaper.class);
                  startActivity(wall);
                  break;
                case 5:
                  /**
                   * * This launches my community on G+ * Please leave this link in here for others
                   * to join. Thank You!
                   */
                  Intent gpCommunity =
                      new Intent(Intent.ACTION_VIEW).setData(Uri.parse("http://bit.ly/14F6Eez"));
                  startActivity(gpCommunity);
                  break;
              }
            }
          }

          /**
           * * This is the code needed to check the package in case 0 * If you remove that check,
           * you can remove this code too * Leaving it here won't harm anything either
           */
          public boolean isPackageExists(String targetPackage) {
            List<ApplicationInfo> packages;
            PackageManager pm;
            pm = getSherlockActivity().getPackageManager();
            packages = pm.getInstalledApplications(0);
            for (ApplicationInfo packageInfo : packages) {
              if (packageInfo.packageName.equals(targetPackage)) return true;
            }
            return false;
          }
        });
  }
  @SuppressWarnings("deprecation")
  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Button main_eventos, main_sitios, main_buscar, main_descubre;

    // debe ser llamado para crear el menú, de lo contrario no aparecerán los items en el actionbar
    setHasOptionsMenu(true);
    changeActionBar();

    setRetainInstance(true);
    // setRetainInstance(true) will tell the FragmentManager to keep the fragment around when the
    // containing Activity is killed and rebuilt for some reason.
    // It doesn't guarantee that the Fragment instance will stick around after a transaction to add
    // or replace.

    // hace referencia al objeto de la clase Main_fragment con todas las propiedades del slidingMenu
    slidingMenu = Main_FragmentActivity.putReference();

    /*codigo de animationDrawable, fondo que cambia en la pantalla principal*/
    // animacion asociada al linearLayout (tema 3 de Android - Dibujar en Android - pag 10)
    main_Layout = (LinearLayout) getActivity().findViewById(R.id.main_bg_layout);
    animacion_backgrounds =
        (AnimationDrawable) getActivity().getResources().getDrawable(R.anim.animacion_main_bg);

    // comprobacion si la version de android en la que se ejecuta es anterior a la
    // honeycomb(target16)
    // ya que setBackgroundDrawable es deprecated.
    if (Build.VERSION.SDK_INT <= 16) main_Layout.setBackgroundDrawable(animacion_backgrounds);
    else main_Layout.setBackground(animacion_backgrounds);

    new Handler()
        .postDelayed(
            new Runnable() {
              @Override
              public void run() {

                animacion_backgrounds.start();
              }
            },
            500);

    // cambiar typeface's a los botones de la pantalla principal
    main_eventos = (Button) getActivity().findViewById(R.id.main_eventos_button);
    main_eventos.setTypeface(robotoBoldCondensed);
    main_eventos.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            newContent = new Main_Eventos();

            if (newContent != null) {
              switchFragment(newContent);
            }
          }
        });

    main_sitios = (Button) getActivity().findViewById(R.id.main_sitios_visitados_button);
    main_sitios.setTypeface(robotoBoldCondensed);

    main_buscar = (Button) getActivity().findViewById(R.id.main_buscar_sitio_button);
    main_buscar.setTypeface(robotoBoldCondensed);
    main_buscar.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            ArrayList<LugaresDeInteres_Item> arrayListAllLugares =
                LugaresDeInteres_Data_Objects.AllTheLugaresDeInteres(getActivity());
            Main_FragmentActivity mFragmentActivity = (Main_FragmentActivity) getActivity();
            mFragmentActivity.onBuscarSeleccionado(arrayListAllLugares);
          }
        });

    main_descubre = (Button) getActivity().findViewById(R.id.main_descubre_button);
    main_descubre.setTypeface(robotoBoldCondensed);
    main_descubre.setOnClickListener(
        new OnClickListener() {
          // abrir el menu con el boton descubre valencia
          @Override
          public void onClick(View v) {
            if (slidingMenu.isShown())
              new Handler()
                  .postDelayed(
                      new Runnable() {

                        @Override
                        public void run() {
                          slidingMenu.toggle();
                        }
                      },
                      80);
          }
        });
  }
Exemplo n.º 24
0
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   getPrefs();
   thread.execute();
 }
Exemplo n.º 25
0
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    flag = false;
    tap = (Button) getActivity().findViewById(R.id.tap);
    reset = (Button) getActivity().findViewById(R.id.reset);
    play = (Button) getActivity().findViewById(R.id.start);
    times = new ArrayList<Long>();
    pool = new SoundPool(2, AudioManager.STREAM_MUSIC, 0);
    // tv2 = (TextView)getActivity().findViewById(R.id.tv2);
    // tv2.setText("done");
    initMetronome();
    resetShit();
    play.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            fla = true;
            tv = (TextView) getActivity().findViewById(R.id.test);
            tv = (TextView) getActivity().findViewById(R.id.test);

            tempo = (TextView) getActivity().findViewById(R.id.tempo);
            pool.play(faget.get(1), 1, 1, 1, 0, 1);
            isPlaying = true;
            h = new Handler();
            r =
                new Runnable() {
                  public void run() {
                    if (fla == true) {
                      pool.play(faget.get(0), 1, 1, 1, 0, 1);
                      h.postDelayed(this, (long) (60000.0 / tem));
                    }
                  }
                };
            h.postDelayed(r, 500);
          }
        });
    reset.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {
            resetShit();
          }
        });
    tap.setOnClickListener(
        new OnClickListener() {
          public void onClick(View v) {

            Log.d("flag", Boolean.toString(flag));
            tv = (TextView) getActivity().findViewById(R.id.test);

            tempo = (TextView) getActivity().findViewById(R.id.tempo);
            play = (Button) getActivity().findViewById(R.id.start);
            if (flag == false) {
              flag = true;
              start = System.currentTimeMillis();
              times.add(start);
            } else {
              play.setEnabled(true);
              rep++;
              times.add(System.currentTimeMillis());

              t = (times.get(rep) - times.get(rep - 1)) / 1000.0;
              tv.setText(Double.toString(t));
              total += t;
              avg = rep / total + 0.0;
              tem = avg * 60.0;
              tempo.setText(Double.toString(tem));
              Tempo t = (Tempo) getActivity();
              t.setObjects(pool, tem, isPlaying);
            }
          }
        });
  }