Results 1 to 5 of 5

Thread: runtime error

  1. #1
    larryse is offline Member
    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0

    Default runtime error

    I am creating an app with a custom listview. When I run on my phone I get an error in my XML file.

    Code:
    Java Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
        
    	<ListView android:id="@+id/listview"
    	    android:layout_height="fill_parent"
    	    android:layout_width="fill_parent"
    	    android:orientation="vertical">
    	</ListView>
    </LinearLayout>
    My activity is
    Java Code:
    package com.example.sarahjmusicprotocol;
    
    import java.util.ArrayList;
    import java.util.List;
    import android.os.Bundle;
    import android.app.Activity;
    import android.app.ListActivity;
    import android.view.Menu;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;
    
    public class MainActivity extends Activity 
    {
    	private ListView view;
    	private CategoryAdapter adapter;
    	private List<CategoriesObject> categoriesList;
    	
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.main);
    		
    		categoriesList = CategoryDomain.getCategoryDomain().getCategories();
    		view = (ListView)findViewById(R.id.listview);
    		adapter = new CategoryAdapter(MainActivity.this,R.id.listview,categoriesList);
    		view.setAdapter(adapter);
    			
    		
    		//categories = new String[] {"Pubishing","Royalties","Self Promotion","Legal Advice","Production Protocol","Music Submission Protocol","Production/Songwriting Submission Opportunities","Music Submission Opportunities","Booking Info"};
    		
    		//setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, categories));
    	}
    
    	@Override
    	public boolean onCreateOptionsMenu(Menu menu) {
    		// Inflate the menu; this adds items to the action bar if it is present.
    		//getMenuInflater().inflate(R.menu.main, menu);
    		return true;
    	}
    
    }


    My error says
    07-27 15:54:33.058: E/AndroidRuntime(6074): FATAL EXCEPTION: main
    07-27 15:54:33.058: E/AndroidRuntime(6074): android.view.InflateException: Binary XML file line #7: Error inflating class LinarLayout
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:581)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.rInflate(LayoutInflate r.java:623)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.inflate(LayoutInflater .java:408)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.inflate(LayoutInflater .java:320)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.inflate(LayoutInflater .java:276)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at com.example.sarahjmusicprotocol.CategoryAdapter.ge tView(CategoryAdapter.java:40)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.AbsListView.obtainView(AbsListView. java:1554)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.ListView.makeAndAddView(ListView.ja va:1793)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.ListView.fillDown(ListView.java:718 )
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.ListView.fillFromTop(ListView.java: 775)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.ListView.layoutChildren(ListView.ja va:1646)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.AbsListView.onLayout(AbsListView.ja va:1384)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.View.layout(View.java:7228)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.LinearLayout.setChildFrame(LinearLa yout.java:1254)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.LinearLayout.layoutVertical(LinearL ayout.java:1130)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.LinearLayout.onLayout(LinearLayout. java:1047)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.View.layout(View.java:7228)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.FrameLayout.onLayout(FrameLayout.ja va:338)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.View.layout(View.java:7228)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.LinearLayout.setChildFrame(LinearLa yout.java:1254)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.LinearLayout.layoutVertical(LinearL ayout.java:1130)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.LinearLayout.onLayout(LinearLayout. java:1047)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.View.layout(View.java:7228)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.widget.FrameLayout.onLayout(FrameLayout.ja va:338)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.View.layout(View.java:7228)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.ViewRoot.performTraversals(ViewRoot.j ava:1145)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.ViewRoot.handleMessage(ViewRoot.java: 1865)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.os.Handler.dispatchMessage(Handler.java:99 )
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.os.Looper.loop(Looper.java:123)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.app.ActivityThread.main(ActivityThread.jav a:3687)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at java.lang.reflect.Method.invokeNative(Native Method)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at java.lang.reflect.Method.invoke(Method.java:507)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:842)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:600)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at dalvik.system.NativeStart.main(Native Method)
    07-27 15:54:33.058: E/AndroidRuntime(6074): Caused by: java.lang.ClassNotFoundException: android.view.LinarLayout in loader dalvik.system.PathClassLoader[/data/app/com.example.sarahjmusicprotocol-1.apk]
    07-27 15:54:33.058: E/AndroidRuntime(6074): at dalvik.system.PathClassLoader.findClass(PathClassL oader.java:240)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 51)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 11)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.createView(LayoutInfla ter.java:471)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.onCreateView(LayoutInf later.java:549)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at com.android.internal.policy.impl.PhoneLayoutInflat er.onCreateView(PhoneLayoutInflater.java:66)
    07-27 15:54:33.058: E/AndroidRuntime(6074): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:568)
    07-27 15:54:33.058: E/AndroidRuntime(6074): ... 34 more

    Does anyone have any ideas or do i need more code pasted?
    Last edited by larryse; 07-28-2013 at 05:56 AM.

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: runtime error

    Are you sure that's the XML file the error refers to?

    07-27 15:54:33.058: E/AndroidRuntime(6074): android.view.InflateException: Binary XML file line #7: Error inflating class LinarLayout
    Get in the habit of using standard Java naming conventions!

  3. #3
    larryse is offline Member
    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0

    Default Re: runtime error

    Quote Originally Posted by kjkrum View Post
    Are you sure that's the XML file the error refers to?

    07-27 15:54:33.058: E/AndroidRuntime(6074): android.view.InflateException: Binary XML file line #7: Error inflating class LinarLayout
    oppps wrong xml. this is main.xml

    Java Code:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" >
        
        <LinarLayout android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
            <TextView android:textSize="12dip"
                android:id="@+id/big"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">
            </TextView>
        </LinarLayout>
    </LinearLayout>

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: runtime error

    Look closely at the bold part of my first comment.
    Get in the habit of using standard Java naming conventions!

  5. #5
    larryse is offline Member
    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0

Similar Threads

  1. RunTime Error
    By LuciferxFatality in forum New To Java
    Replies: 4
    Last Post: 07-04-2011, 04:41 AM
  2. runtime error
    By ashaudhaya in forum New To Java
    Replies: 2
    Last Post: 11-12-2010, 10:13 AM
  3. Runtime Error
    By mathfxr in forum New To Java
    Replies: 8
    Last Post: 09-17-2010, 08:26 PM
  4. RunTime Error
    By LostinJavaLand in forum New To Java
    Replies: 3
    Last Post: 07-12-2010, 01:30 PM
  5. Replies: 3
    Last Post: 01-23-2009, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •