Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I changed my onCreate() in my ItemListFragment to:</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d("debug","Hallo in ItemListFragment"); //show ActionBar setHasOptionsMenu(true); //get reference to activity myApp = getActivity().getApplication(); //check if intent from ItemListActivity is null Bundle be = getActivity().getIntent().getExtras(); if (be == null){ //if null read local feed feed = ReadFeed(fileName); Log.d("debug", "Lese Feed lokal :"+feed); }else{ //else get extras from the intent feed = (RSSFeed) getActivity().getIntent().getExtras().get("feed"); Log.d("debug", "Intent von ItemListActivity an ItemListFragment vorhanden"); } } </code></pre> <p>and added this function:</p> <pre><code>/** * Method to read the feed from the file **/ private RSSFeed ReadFeed(String fName) { FileInputStream fIn = null; ObjectInputStream isr = null; RSSFeed _feed = null; File feedFile = getActivity().getBaseContext().getFileStreamPath(fileName); if (!feedFile.exists()) return null; try { fIn = getActivity().openFileInput(fName); isr = new ObjectInputStream(fIn); _feed = (RSSFeed) isr.readObject(); } catch (Exception e) { e.printStackTrace(); } finally { try { fIn.close(); } catch (IOException e) { e.printStackTrace(); } } return _feed; } </code></pre> <p>Of course I use a similar write method in my Main Activity where I parse my XML feed the first time. </p> <p>In the ItemDetailFragment I removed every code for ActionBar navigation and works fine now!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload