Android Open Source - Planets-App Fragment Home

From Project

Back to project page Planets-App.


The source code is released under:

Apache License

If you think the Android project Planets-App listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.andrewq.planets;
//from  w ww.  j  av  a 2 s .co m
import android.os.Bundle;
import android.os.Handler;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


public class FragmentHome extends Fragment {

    TextView mQuoteView;
    Handler handler = new Handler();
    Runnable updateTextRunnable = new Runnable() {

        public void run() {
            final String quotes = mRandomQuotes.getQuotes();
    private RandomQuotes mRandomQuotes = new RandomQuotes();

    public FragmentHome() {
        // Required empty public constructor

    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_home, container, false);
        mQuoteView = (TextView) v.findViewById(;

        return v;

    public void onStart() {
        EasyTracker.getInstance(getActivity()).activityStart(getActivity());  // Add this method.

    public void onStop() {
        EasyTracker.getInstance(getActivity()).activityStop(getActivity());  // Add this method.


Java Source Code List