Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 实现HorizontaListView Android_Java_Android_Xml_Listview - Fatal编程技术网

Java 实现HorizontaListView Android

Java 实现HorizontaListView Android,java,android,xml,listview,Java,Android,Xml,Listview,我正在尝试使用此库: 我从demo文件夹复制并粘贴了SimpleListActivity,并复制了所有其他需要的文件,包括维度文件。但它仍然处于崩溃状态,根本没有运行 以下是我所做的: SimpleHListActivity.java import android.app.Activity; import android.content.Context; import android.support.v4.util.SparseArrayCompat; import android.os

我正在尝试使用此库:

我从demo文件夹复制并粘贴了SimpleListActivity,并复制了所有其他需要的文件,包括维度文件。但它仍然处于崩溃状态,根本没有运行

以下是我所做的:

SimpleHListActivity.java

    import android.app.Activity;
import android.content.Context;
import android.support.v4.util.SparseArrayCompat;
import android.os.Bundle;
import android.util.Log;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import it.sephiroth.android.library.util.v11.MultiChoiceModeListener;
import it.sephiroth.android.library.widget.HListView;


public class SimpleHListActivity extends Activity implements View.OnClickListener, it.sephiroth.android.library.widget.AdapterView.OnItemClickListener {
    private static final String LOG_TAG = "SimpleHListActivity";
    HListView listView;
    Button mButton1;
    Button mButton2;
    Button mButton3;
    TestAdapter mAdapter;
    @Override
    protected void onCreate( Bundle savedInstanceState ) {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main );
        List<String> items = new ArrayList<String>();
        for( int i = 0; i < 50; i++ ) {
            items.add( String.valueOf( i ) );
        }
        mAdapter = new TestAdapter( this, R.layout.test_item_1, android.R.id.text1, items );
        listView.setHeaderDividersEnabled( true );
        listView.setFooterDividersEnabled( true );
        if( listView.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE_MODAL ) {
            listView.setMultiChoiceModeListener( new MultiChoiceModeListener() {
                @Override
                public boolean onPrepareActionMode( ActionMode mode, Menu menu ) {
                    return true;
                }
                @Override
                public void onDestroyActionMode( ActionMode mode ) {
                }
                @Override
                public boolean onCreateActionMode( ActionMode mode, Menu menu ) {
                    menu.add( 0, 0, 0, "Delete" );
                    return true;
                }
                @Override
                public boolean onActionItemClicked( ActionMode mode, MenuItem item ) {
                    Log.d(LOG_TAG, "onActionItemClicked: " + item.getItemId());
                    final int itemId = item.getItemId();
                    if( itemId == 0 ) {
                        deleteSelectedItems();
                    }
                    mode.finish();
                    return false;
                }
                @Override
                public void onItemCheckedStateChanged( ActionMode mode, int position, long id, boolean checked ) {
                    mode.setTitle( "What the...!" );
                    mode.setSubtitle( "Selected items: " + listView.getCheckedItemCount() );
                }
            } );
        } else if( listView.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE ) {
            listView.setOnItemClickListener(this);
        }
        listView.setAdapter( mAdapter );
        mButton1.setOnClickListener( this );
        mButton2.setOnClickListener( this );
        mButton3.setOnClickListener( this );
        Log.i( LOG_TAG, "choice mode: " + listView.getChoiceMode() );
    }
    @Override
    public void onContentChanged() {
        super.onContentChanged();
        listView = (HListView) findViewById( R.id.hListView1 );
        mButton1 = (Button) findViewById( R.id.button1 );
        mButton2 = (Button) findViewById( R.id.button2 );
        mButton3 = (Button) findViewById( R.id.button3 );
    }
    @Override
    public void onClick( View v ) {
        final int id = v.getId();
        if( id == mButton1.getId() ) {
            addElements();
        } else if( id == mButton2.getId() ) {
            removeElements();
        } else if( id == mButton3.getId() ) {
            scrollList();
        }
    }
    private void scrollList() {
        listView.smoothScrollBy( 1500, 300 );
    }
    private void addElements() {
        for( int i = 0; i < 5; i++ ) {
            mAdapter.mItems.add( Math.min( mAdapter.mItems.size(), 2), String.valueOf( mAdapter.mItems.size() ) );
        }
        mAdapter.notifyDataSetChanged();
    }
    private void removeElements() {
        for( int i = 0; i < 5; i++ ) {
            if( mAdapter.mItems.size() > 0 ) {
                mAdapter.mItems.remove( Math.min( mAdapter.mItems.size()-1, 2 ) );
            }
        }
        mAdapter.notifyDataSetChanged();
    }
    private void deleteSelectedItems() {
        SparseArrayCompat<Boolean> checkedItems = listView.getCheckedItemPositions();
        ArrayList<Integer> sorted = new ArrayList<Integer>( checkedItems.size() );
        Log.i( LOG_TAG, "deleting: " + checkedItems.size() );
        for( int i = 0; i < checkedItems.size(); i++ ) {
            if( checkedItems.valueAt( i ) ) {
                sorted.add( checkedItems.keyAt( i ) );
            }
        }
        Collections.sort(sorted);
        for( int i = sorted.size()-1; i >= 0; i-- ) {
            int position = sorted.get( i );
            Log.d( LOG_TAG, "Deleting item at: " + position );
            mAdapter.mItems.remove( position );
        }
        mAdapter.notifyDataSetChanged();
    }


    @Override
    public void onItemClick(it.sephiroth.android.library.widget.AdapterView<?> adapterView, View view, int position, long l) {
        Log.i( LOG_TAG, "onItemClick: " + position );
        Log.d( LOG_TAG, "checked items: " + listView.getCheckedItemCount() );
        Log.d( LOG_TAG, "checked positions: " + listView.getCheckedItemPositions() );
    }

    class TestAdapter extends ArrayAdapter<String> {
        List<String> mItems;
        LayoutInflater mInflater;
        int mResource;
        int mTextResId;
        public TestAdapter( Context context, int resourceId, int textViewResourceId, List<String> objects ) {
            super( context, resourceId, textViewResourceId, objects );
            mInflater = LayoutInflater.from( context );
            mResource = resourceId;
            mTextResId = textViewResourceId;
            mItems = objects;
        }
        @Override
        public boolean hasStableIds() {
            return true;
        }
        @Override
        public long getItemId( int position ) {
            return getItem( position ).hashCode();
        }
        @Override
        public int getViewTypeCount() {
            return 3;
        }
        @Override
        public int getItemViewType( int position ) {
            return position%3;
        }
        @Override
        public View getView( int position, View convertView, ViewGroup parent ) {
            if( null == convertView ) {
                convertView = mInflater.inflate( mResource, parent, false );
            }
            TextView textView = (TextView) convertView.findViewById( mTextResId );
            textView.setText( getItem( position ) );
            int type = getItemViewType( position );
            ViewGroup.LayoutParams params = convertView.getLayoutParams();
            if( type == 0 ) {
                params.width = getResources().getDimensionPixelSize( R.dimen.item_size_1 );
            } else if( type == 1 ) {
                params.width = getResources().getDimensionPixelSize( R.dimen.item_size_2 );
            } else {
                params.width = getResources().getDimensionPixelSize( R.dimen.item_size_3 );
            }
            return convertView;
        }
    }
}
提前谢谢你的帮助。 问候

更新 它不在演示文件上,所以我没有放进去。 我确实把它放在了那里,但仍然有错误。这是在放置listView=(HListView)findViewById(R.id.hListView1)之后的logcat;在设置标题行之前。 更新onCreate:

@Override
protected void onCreate( Bundle savedInstanceState ) {
    super.onCreate( savedInstanceState );
    setContentView( R.layout.activity_main );
    List<String> items = new ArrayList<String>();
    for( int i = 0; i < 50; i++ ) {
        items.add( String.valueOf( i ) );
    }
    mAdapter = new TestAdapter( this, R.layout.test_item_1, android.R.id.text1, items );
    listView = (HListView) findViewById(R.id.hListView1);
    listView.setHeaderDividersEnabled( true );
    listView.setFooterDividersEnabled( true );
    if( listView.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE_MODAL ) {
        listView.setMultiChoiceModeListener( new MultiChoiceModeListener() {
            @Override
            public boolean onPrepareActionMode( ActionMode mode, Menu menu ) {
                return true;
            }
            @Override
            public void onDestroyActionMode( ActionMode mode ) {
            }
            @Override
            public boolean onCreateActionMode( ActionMode mode, Menu menu ) {
                menu.add( 0, 0, 0, "Delete" );
                return true;
            }
            @Override
            public boolean onActionItemClicked( ActionMode mode, MenuItem item ) {
                Log.d(LOG_TAG, "onActionItemClicked: " + item.getItemId());
                final int itemId = item.getItemId();
                if( itemId == 0 ) {
                    deleteSelectedItems();
                }
                mode.finish();
                return false;
            }
            @Override
            public void onItemCheckedStateChanged( ActionMode mode, int position, long id, boolean checked ) {
                mode.setTitle( "What the fuck!" );
                mode.setSubtitle( "Selected items: " + listView.getCheckedItemCount() );
            }
        } );
    } else if( listView.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE ) {
        listView.setOnItemClickListener(this);
    }
    listView.setAdapter( mAdapter );
    mButton1.setOnClickListener( this );
    mButton2.setOnClickListener( this );
    mButton3.setOnClickListener( this );
    Log.i( LOG_TAG, "choice mode: " + listView.getChoiceMode() );
}

错误的内容视图setContentView(R.layout.activity_main)


应该是setContentView(R.layout.activity\u simple\u hlist)

您的listView对象为空。添加listView=(HListView)findViewById(R.id.hListView1);在此行之前:listView.SetHeaderDividerEnabled(true);将listView引用(绑定)到xml视图id。使用logcat更新问题并更新onCreate。它不在演示文件中。这就是为什么我没有把它放在那里。我确实把它放在了那里,但仍然有错误。得到并修复了它,我将它设置为一个错误的contentview setContentView(R.layout.activity_main);
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/text_background_selector"
    android:orientation="vertical"
    android:gravity="center"
    android:padding="5dip">
    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher"
        android:scaleType="centerInside"
        android:adjustViewBounds="false" />
    <TextView
        android:id="@android:id/text1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
    <item android:state_selected="true" android:drawable="@drawable/list_selector_background_selected" />
    <item android:state_activated="true" android:drawable="@drawable/list_selector_background_selected" />
    <item android:state_checked="true" android:drawable="@drawable/list_selector_background_selected" />
    <item android:state_pressed="true" android:drawable="@android:color/transparent" />
    <item android:drawable="@android:color/white" />
</selector>
01-27 15:53:31.150    4161-4161/com.shaheed.myapplication D/AndroidRuntime﹕ Shutting down VM
01-27 15:53:31.150    4161-4161/com.shaheed.myapplication W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2b542210)
01-27 15:53:31.160    4161-4161/com.shaheed.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shaheed.myapplication/com.shaheed.myapplication.SimpleHListActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at com.shaheed.myapplication.SimpleHListActivity.onCreate(SimpleHListActivity.java:46)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
01-27 15:53:32.680    4161-4161/com.shaheed.myapplication I/Process﹕ Sending signal. PID: 4161 SIG: 9
01-27 15:56:22.100    4477-4477/com.shaheed.myapplication D/dalvikvm﹕ Late-enabling CheckJNI
01-27 15:56:22.420    4477-4477/com.shaheed.myapplication D/AndroidRuntime﹕ Shutting down VM
01-27 15:56:22.420    4477-4477/com.shaheed.myapplication W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2b542210)
01-27 15:56:22.430    4477-4477/com.shaheed.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shaheed.myapplication/com.shaheed.myapplication.SimpleHListActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at com.shaheed.myapplication.SimpleHListActivity.onCreate(SimpleHListActivity.java:47)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
01-27 15:57:58.000    4595-4595/com.shaheed.myapplication D/AndroidRuntime﹕ Shutting down VM
01-27 15:57:58.000    4595-4595/com.shaheed.myapplication W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2b542210)
01-27 15:57:58.010    4595-4595/com.shaheed.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shaheed.myapplication/com.shaheed.myapplication.SimpleHListActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at com.shaheed.myapplication.SimpleHListActivity.onCreate(SimpleHListActivity.java:46)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
@Override
protected void onCreate( Bundle savedInstanceState ) {
    super.onCreate( savedInstanceState );
    setContentView( R.layout.activity_main );
    List<String> items = new ArrayList<String>();
    for( int i = 0; i < 50; i++ ) {
        items.add( String.valueOf( i ) );
    }
    mAdapter = new TestAdapter( this, R.layout.test_item_1, android.R.id.text1, items );
    listView = (HListView) findViewById(R.id.hListView1);
    listView.setHeaderDividersEnabled( true );
    listView.setFooterDividersEnabled( true );
    if( listView.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE_MODAL ) {
        listView.setMultiChoiceModeListener( new MultiChoiceModeListener() {
            @Override
            public boolean onPrepareActionMode( ActionMode mode, Menu menu ) {
                return true;
            }
            @Override
            public void onDestroyActionMode( ActionMode mode ) {
            }
            @Override
            public boolean onCreateActionMode( ActionMode mode, Menu menu ) {
                menu.add( 0, 0, 0, "Delete" );
                return true;
            }
            @Override
            public boolean onActionItemClicked( ActionMode mode, MenuItem item ) {
                Log.d(LOG_TAG, "onActionItemClicked: " + item.getItemId());
                final int itemId = item.getItemId();
                if( itemId == 0 ) {
                    deleteSelectedItems();
                }
                mode.finish();
                return false;
            }
            @Override
            public void onItemCheckedStateChanged( ActionMode mode, int position, long id, boolean checked ) {
                mode.setTitle( "What the fuck!" );
                mode.setSubtitle( "Selected items: " + listView.getCheckedItemCount() );
            }
        } );
    } else if( listView.getChoiceMode() == ListView.CHOICE_MODE_MULTIPLE ) {
        listView.setOnItemClickListener(this);
    }
    listView.setAdapter( mAdapter );
    mButton1.setOnClickListener( this );
    mButton2.setOnClickListener( this );
    mButton3.setOnClickListener( this );
    Log.i( LOG_TAG, "choice mode: " + listView.getChoiceMode() );
}
01-27 16:19:46.680    4982-4982/com.shaheed.myapplication D/AndroidRuntime﹕ Shutting down VM
01-27 16:19:46.680    4982-4982/com.shaheed.myapplication W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x2b542210)
01-27 16:19:46.690    4982-4982/com.shaheed.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shaheed.myapplication/com.shaheed.myapplication.SimpleHListActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at com.shaheed.myapplication.SimpleHListActivity.onCreate(SimpleHListActivity.java:44)
            at android.app.Activity.performCreate(Activity.java:4465)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
            at android.app.ActivityThread.access$600(ActivityThread.java:127)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4441)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
            at dalvik.system.NativeStart.main(Native Method)