Android Open Source - disconnected-content-explorer-android Report Detail Fragment

From Project

Back to project page disconnected-content-explorer-android.


The source code is released under:

MIT License

If you think the Android project disconnected-content-explorer-android 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

/*w  w w  . j av a  2  s. co  m*/

import android.annotation.TargetApi;
import android.os.Build;
import mil.nga.dice.R;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;

 * A fragment representing a single Report detail screen. This fragment is
 * either contained in a {@link ReportDetailActivity}.
public class ReportDetailFragment extends Fragment {
   * The fragment argument representing the item ID that this fragment
   * represents.
  public static final String ARG_ITEM_ID = "item_id";
  public static final String ARG_REPORT = "report";
  private Report mReport;

   * Mandatory empty constructor for the fragment manager to instantiate the
   * fragment (e.g. upon screen orientation changes).
  public ReportDetailFragment() {

  public void onCreate(Bundle savedInstanceState) {
    if (getArguments().containsKey(ARG_REPORT)) {
      mReport = getArguments().getParcelable(ARG_REPORT);

  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_report_detail, container, false);
    if (mReport == null) {
      return rootView;
    File reportFile = new File(mReport.getPath(), "index.html");
    if (reportFile.canRead() && reportFile.length() > 0) {
      WebView webView = (WebView) rootView.findViewById(;
      // TODO: block network?
      // webView.getSettings().getBlockNetworkLoads();
    return rootView;

  private void enableFileAjax(WebView webView) {


Java Source Code List