Note that there are some explanatory texts on larger screens.

plurals
  1. POXmlapter example not working .contains (contacts reader,Rss feeds,photos display)
    primarykey
    data
    text
    <p>I am developing <strong>RSS Feeds</strong> application from the basic google resource folder. Right now I am display all three contents as suggested into example.</p> <p>1.Contacts. 2.Photos. 3.RSS Feed</p> <p>here is link:</p> <p><a href="http://developer.android.com/resources/samples/XmlAdapters/src/com/example/android/xmladapters/index.html" rel="nofollow">RSS FIELD -xmladapters</a></p> <p>I managed code very well as per my requirement .only change the package and Project name. But its display Fatal Error:</p> <p><strong>LOGCAT:</strong></p> <pre><code> 04-09 17:40:02.894: E/AndroidRuntime(770): FATAL EXCEPTION: main 04-09 17:40:02.894: E/AndroidRuntime(770): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.satyamdswt.agreader/com.satyamdswt.agreader.ContactsListActivity}: java.lang.IllegalArgumentException: The layout specified in contacts does not exist 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.os.Handler.dispatchMessage(Handler.java:99) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.os.Looper.loop(Looper.java:123) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread.main(ActivityThread.java:3683) 04-09 17:40:02.894: E/AndroidRuntime(770): at java.lang.reflect.Method.invokeNative(Native Method) 04-09 17:40:02.894: E/AndroidRuntime(770): at java.lang.reflect.Method.invoke(Method.java:507) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 04-09 17:40:02.894: E/AndroidRuntime(770): at dalvik.system.NativeStart.main(Native Method) 04-09 17:40:02.894: E/AndroidRuntime(770): Caused by: java.lang.IllegalArgumentException: The layout specified in contacts does not exist 04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters$XmlCursorAdapterParser.parse(Adapters.java:219) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters.createCursorAdapter(Adapters.java:168) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters.createAdapterFromXml(Adapters.java:151) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters.loadAdapter(Adapters.java:105) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.Adapters.loadAdapter(Adapters.java:92) 04-09 17:40:02.894: E/AndroidRuntime(770): at com.satyamdswt.agreader.ContactsListActivity.onCreate(ContactsListActivity.java:12) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 04-09 17:40:02.894: E/AndroidRuntime(770): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 04-09 17:40:02.894: E/AndroidRuntime(770): ... 11 more </code></pre> <p>In LogCat you see that:</p> <pre><code>com.satyamdswt.agreader/com.satyamdswt.agreader.ContactsListActivity </code></pre> <p>I don't know why this happened two times.</p> <p>For more I display my Manifest.xml here: <strong>Manifest.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.satyamdswt.agreader" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="10" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;uses-permission android:name="android.permission.READ_CONTACTS"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;activity android:name=".ContactsListActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name="PhotosListActivity" android:label="@string/photos_list_activity"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".AGRssReaderActivity"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Please guide me where is Error.</p> <p><strong>ContactListActivity.java</strong></p> <pre><code>public class ContactsListActivity extends ListActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.contacts_list); setListAdapter(Adapters.loadAdapter(this,R.xml.contacts )); } } </code></pre> <p><strong>EDITED</strong> contacts.xml</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;cursor-adapter xmlns:android="com.satyamdswt.agreader" xmlns:app="http://schemas.android.com/apk/res/com.satyamdswt.agreader" android:layout_width="@layout/contact_item" app:selection="has_phone_number = 1 " app:uri="content://com.satyamdswt.contacts/contacts" &gt; &lt;bind app:from="display_name" app:to="@id/name" app:as="string"/&gt; &lt;bind app:as="drawable" app:from="starred" app:to="@id/star" &gt; &lt;map app:fromValue="0" app:toValue="@android:drawable/star_big_off" /&gt; &lt;map app:fromValue="1" app:toValue="@android:drawable/star_big_on" /&gt; &lt;/bind&gt; &lt;bind app:as="com.satyamdswt.agreader.ContactPhotoBinder" app:from="_id" app:to="@id/name" /&gt; &lt;/cursor-adapter&gt; </code></pre>
    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.
 

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