Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The correct syntax is <code>@android:id/list</code> instead of <code>@id/android:list</code></p> <p>Also, I'd write <code>listfragmentexample</code> instead of <code>Listfragmentexample</code> and instead of <code>ListFragmentExample</code>. Your capitalization of that package name really wasn't consistent between your main.xml file and your manifest file. Besides, personally, I wouldn't even capitalize that word at all. </p> <p>This should take care of your error. </p> <p>But personally, I'd also write <code>".ListFragmentExampleActivity"</code> instead of <code>"net.learn2develop.Listfragmentexample.ListFragmentExampleActivity"</code> just to simplify the manifest. It really didn't need to be that complicated. And this last change I'm suggesting won't fix anything, it just makes the manifest more readable. </p> <p><strong>Update:</strong></p> <p>From your chat, it does seem that Stonebird picked up on the inconsistent capitalization of the package name reference, it's just that this inconsistent capitalization needs to be corrected in more than just the manifest activity android:name.</p> <p>In the manifest activity android:name, please just do what I suggested above. Write <code>".ListFragmentExampleActivity"</code> instead of <code>"net.learn2develop.Listfragmentexample.ListFragmentExampleActivity"</code></p> <p>Then within the project explorer pane of Eclipse, place your mouse on the package name, right-click and select: </p> <p><code>Refactor &gt; Rename</code> to <code>"net.learn2develop.listfragmentexample"</code> instead of <code>"net.learn2develop.Listfragmentexample"</code> Make sure to check the checkbox that says Update all references and to preview your changes (don't worry about the errors you're getting after that, there still needs some work left to do). And if it asks you to update configuration launch files, accept that as well. Turning all your package names to lower case (except for the ClassName part) is a good habit to have in Java, because then you don't need to start remembering what particular case you used on what. </p> <p>After that, on the second or third line of your manifest, make sure to write <code>"net.learn2develop.listfragmentexample"</code> instead of <code>"net.learn2develop.Listfragmentexample"</code> (I don't think that the Eclipse Refactor command took care of that one).</p> <p>Then in your main.xml, write <code>"net.learn2develop.listfragmentexample.Fragment1"</code> instead of <code>"net.learn2develop.ListFragmentExample.Fragment1"</code> and write <code>"net.learn2develop.listfragmentexample.Fragment2"</code> instead of <code>"net.learn2develop.ListFragmentExample.Fragment2"</code> (normally, Eclipse Refactor takes care of renaming those attributes, but it didn't in this case because the capitalization mistake in this case is not even consistent with your first capitalization mistake, so it wouldn't pick up on that when doing its search and replace)</p> <p>And finally, in <strong>all</strong> your java files, make sure that it's written: </p> <p><code>package net.learn2develop.listfragmentexample;</code> instead of </p> <p><code>package net.learn2develop.Listfragmentexample;</code> (this part should have been taken care by Eclipse, but this is something you should double-check just in case).</p> <p>After that, do a Ctrl-shift-o within each java file (to organize the imports). If you did that step too early before you properly reset the package name, then it will have imported android.R (which is <strong>NOT</strong> what you want). Make sure that <code>import android.R;</code> does <strong>not</strong> appear anywhere in your java files. If it's there, delete that line, and do a Ctrl-shift-o (to organize imports) until your own R is imported and <strong>not</strong> the android.R</p> <p>After that, with your mouse select <code>Project &gt; Clean...</code> or <code>Source &gt; Clean...</code> (I forget which menu). And if Eclipse errors, open the Eclipse Error View Pane to make sure you didn't miss any other places where the previous package names needed to be changed. From the Error View pane, you can double-click on each error in question to take you to the spot where Eclipse thinks the mistake is located. </p>
    singulars
    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.
 

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