Problem "The application MasterFlow has stopped unexpectedly."

0 sharjeel ashraf · April 6, 2015
I followed everything Bucky said. But I am having this error.
"The application MasterFlow (process com.example.xxxxxx.masterflow) has stopped unexpectedly."

DummyContent.java

package com.example.fasda.masterflow.dummy;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 *
 * TODO: Replace all uses of this class before publishing your app.
 */
public class DummyContent {

    /**
     * An array of sample (dummy) items.
     */
    public static List ITEMS = new ArrayList();

    /**
     * A map of sample (dummy) items, by ID.
     */
    public static Map ITEM_MAP = new HashMap();

    static {
        // Add 3 sample items.
        addItem(new DummyItem("1", "Bucky", "https://www.thenewboston.com/profile.php?user=2"));
        addItem(new DummyItem("2", "Forum", "https://www.thenewboston.com/forum"));
        addItem(new DummyItem("3", "Videos", "https://www.thenewboston.com/videos.php"));
    }

    private static void addItem(DummyItem item) {
        ITEMS.add(item);
        ITEM_MAP.put(item.id, item);
    }

    /**
     * A dummy item representing a piece of content.
     */
    public static class DummyItem {
        public String id;
        public String item_name;
        public String url;

        public DummyItem(String id, String item_name, String url) {
            this.id = id;
            this.item_name = item_name;
            this.url = url;
        }

        @Override
        public String toString() {
            return item_name;
        }
    }
}

WebpagesDetailFragment.java

package com.example.fasda.masterflow;

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.WebView;


import com.example.fasda.masterflow.dummy.DummyContent;

/**
 * A fragment representing a single Webpages detail screen.
 * This fragment is either contained in a {@link WebpagesListActivity}
 * in two-pane mode (on tablets) or a {@link WebpagesDetailActivity}
 * on handsets.
 */
public class WebpagesDetailFragment extends Fragment {
    /**
     * The fragment argument representing the item ID that this fragment
     * represents.
     */
    public static final String ARG_ITEM_ID = "item_id";

    /**
     * The dummy content this fragment is presenting.
     */
    private DummyContent.DummyItem mItem;

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

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (getArguments().containsKey(ARG_ITEM_ID)) {
            // Load the dummy content specified by the fragment
            // arguments. In a real-world scenario, use a Loader
            // to load content from a content provider.
            mItem = DummyContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_webpages_detail, container, false);

        // Show the dummy content as text in a TextView.
        if (mItem != null) {
            ((WebView) rootView.findViewById(R.id.detail_area)).loadUrl(mItem.url);
        }

        return rootView;
    }
}

fragment_webpage_detail.xml



AndroidManifest.xml



   

   
       
           
               

               
           
       
       
           
       
   





Any idea whats the problem?

Post a Reply

Replies

Oldest  Newest  Rating
0 sharjeel ashraf · April 6, 2015
fragment_webpage_detail.xml








AndroidManifest.xml




   

   
       
           
               

               
           
       
       
           
       
   



  • 1

Java / Android Development

107,060 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator