se.eliga.aves.HelpFragment.java Source code

Java tutorial

Introduction

Here is the source code for se.eliga.aves.HelpFragment.java

Source

/*
 * Copyright (c) Claes Holmerson 2013, 2015. The program is licensed under GNU GPL v3. See LICENSE.txt for details.
 */

package se.eliga.aves;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;

import se.eliga.aves.model.Bird;

public class HelpFragment extends Fragment {

    public HelpFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_help, container, false);
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        WebView webView = (WebView) getView().findViewById(R.id.help_text);
        webView.loadUrl("file:///android_asset/help.html");
        webView.setBackgroundColor(0x00FFFFFF);
        webView.setVisibility(View.VISIBLE);
    }
}