Я хочу создать пользовательский список из более чем 10 элементов.Когда я заполняю массив строк более чем 10 элементами и щелкаю 11-й элемент, приложение не запускается.
public class MainActivity extends Activity {
ListView listView;
int position=0;
String[]items={"ab","cd","ef","gh","jk","lm","no","pr","st","uv","wx"};
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
listView = (ListView) findViewById(R.id.lv_country);
ArrayAdapter<String>arrayAdapter=new ArrayAdapter<String>(this,R.layout.custom_list,items);
listView.setAdapter(arrayAdapter);
listView.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> p1, View p2, int p3, long p4)
{
Intent intent;
position=p3;
switch(p3){
case 0:
intent=new Intent(MainActivity.this,Hi.class);
startActivity(intent);
case 1:
intent=new Intent(MainActivity.this,Ba.class);
startActivity(intent);
break;
case 2:
intent=new Intent(MainActivity.this,Dc.class);
startActivity(intent);
break;
case 3:
intent=new Intent(MainActivity.this,Fe.class);
startActivity(intent);
break;
case 4:
intent=new Intent(MainActivity.this,Hg.class);
startActivity(intent);
break;
case 5:
intent=new Intent(MainActivity.this,Kj.class);
startActivity(intent);
break;
case 6:
intent=new Intent(MainActivity.this,Ml.class);
startActivity(intent);
break;
case 7:
intent=new Intent(MainActivity.this,On.class);
startActivity(intent);
break;
case 8:
intent=new Intent(MainActivity.this,Rp.class);
startActivity(intent);
break;
case 9:
intent=new Intent(MainActivity.this,Ts.class);
startActivity(intent);
break;
case 10:
intent=new Intent(MainActivity.this, Spinner_Activity.class);
startActivity(intent);
}
}
});
}
}
в android.view.ViewRootImpl $ InputStage.apply (ViewRootImpl.java: 4196) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:4169) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:6743) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java 096767) 67: 49: 57.933 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:6663) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
в android.view.ViewRootIventlInce $.onInputEvent (ViewRootImpl.java:6846) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
at android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:186) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
в android.view.InputEventReceiver.nativeConsumeBatchedInputEvents (собственный метод) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
в android.view.InputEventReceiver.consumeBatchedInaveEvent (Иван) Иван05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl.doConsumeBatchedInput (ViewRootImpl.java:6817) 05-18 09: 49: 57.933 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl $ ConsumeBatchedInputRunnable.run (ViewRootImpl.java:6869) 05-18 09: 49: 57.934 14335 14335 E AndroidRuntime
в android.view.Choreographer $ CallbackRecord.run (Choreographer.java:966 05:59): 57.934 14335 14335 E AndroidRuntime
на android.view.Choreographer.doCallbacks (Choreographer.java:778) 05-18 09: 49: 57.934 14335 14335 E AndroidRuntime
на android.view.Choreographer.doFrame.Java: 707) 05-18 09: 49: 57,934 14335 14335 E AndroidRuntime
на android.view.Choreographer $ FrameDisplayEventReceiver.run (Choreographer.java:952) 05-18 09: 49: 57.934 14335 14335 E AndroidRuntime
на android.os.Handler.handleCallback (Handler.java:789) 05-18 09: 49: 57.934 14335 14335E AndroidRuntime
в android.os.Handler.dispatchMessage (Handler.java:98) 05-18 09: 49: 57.934 14335 14335 E AndroidRuntime
в android.os.Looper.loop (Looper.java:164)05-18 09: 49: 57.934 14335 14335 E AndroidRuntime на android.app.ActivityThread.main (ActivityThread.java:6809) 05-18 09: 49: 57.934 14335 14335 E AndroidRuntime
на java.lang.reflect.Method.invoke (собственный метод) 05-18 09: 49: 57.934 14335 14335 E AndroidRuntime на com.android.internal.os.Zygote $ MethodAndArgsCaller.run (Zygote.java:240) 05-18 09: 49: 57.934 14335 14335 EAndroidRuntime
на com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
ФАТАЛЬНОЕ ИСКЛЮЧЕНИЕ: главное 05-18 09: 49: 57.94014335 14335 E
Процесс AndroidRuntime: com.mycompany.myapp, PID: 14335 05-18 09: 49: 57,940 14335 14335 E
AndroidRuntime
android.content.ActivityNotFoundException: невозможно найти явный класс активности {com.mycompany.myapp / com.mycompany.myapp.Spinner_Activity};Вы объявили об этой активности в вашем AndroidManifest.xml?05-18 09: 49: 57.940 14335 14335 E AndroidRuntime на android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2123) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.app.Instrumentation.execStartActivity(Instrumentation.java:1801) 05-18 09: 49: 57,940 14335 14335 E AndroidRuntime
в android.app.Activity.startActivityForResult (Activity.java:4495) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.app.Activity.startActivityForResult (Activity.java:4453) 05-18 09:49: 57,940 14335 14335 E AndroidRuntime
в android.app.Activity.startActivity (Activity.java:4814) 05-18 09: 49: 57,940 14335 14335 E AndroidRuntime
в android.app.Activity.startActivity (Activity).java: 4782) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на com.mycompany.myapp.List_Widgets $ 100000000.onItemClick (List_Widgets.java:75) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.widget.AdapterView.performItemClick (AdapterView.java:318) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.widget.AbsListView.performItemClick (AbsListView.java:1197) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.widget.AbsListView $ PerformClick.run (AbsListView.java:3166) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.widget.AbsListView.onTouchUp (AbsListView.java:4131) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
at android.widget.AbsListView.onTouchEvent (AbsListView.java:3878) 05-18 09: 49: 57.940 14335 14335 EAndroidRuntime
в android.view.View.dispatchTouchEvent (View.java:11776) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2959) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2636) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2965) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2650) 05-18 09: 49: 57.940 14335 14335 EAndroidRuntime
в android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2965) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2650) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2965) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2650) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2965) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2650) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на com.android.internal.policy.DecorView.superDispatchTouchEvent (DecorView.java:446) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1848) 05-18 09:49: 57,940 14335 14335 E AndroidRuntime
на android.app.Activity.dispatchTouchEvent (Activity.java:3315) 05-18 09: 49: 57,940 14335 14335 E AndroidRuntime
на com.android.internal.policy.DecorView.dispatchTouchEvent (DecorView.java:408) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.View.dispatchPointerEvent (View.java:12015) 05-18 09: 49: 57.94014335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:4855) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ProcessImpViewRootImpl.java:4638) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:4169) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ InputStage.onDeliverToNext (ViewRootImpl.java:4222) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
вandroid.view.ViewRootImpl $ InputStage.forward (ViewRootImpl.java:4188) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ AsyncInputStage.forward (ViewRootImpl.java:)18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ InputStage.apply (ViewRootImpl.java:4196) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ AsyncInputStage.apply (ViewRootImpl.java:4372) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:4169 05-18) 05: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ InputStage.onDeliverToNext (ViewRootImpl.java:4222) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.Implisionвперед (ViewRootImpl.java:4188) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl $ InputStage.apply (ViewRootImpl.java:4196) 05-18 09: 49: 57.940 14335 14335Е АндрoidRuntime
в android.view.ViewRootImpl $ InputStage.deliver (ViewRootImpl.java:4169) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl.deliverInputEvent67 (ViewRoot) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:6717) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:6663) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.ViewRootImpl $ WindowInputEventReceiver.onInputEvent (ViewRootImpl.java 09:46:46): 6857.940 14335 14335 E AndroidRuntime
в android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:186) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
в android.view.InputEventReceiver.nativeEvent05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.InputEventReceiver.consumeBatchedInputEvents (InputEventReceiver.java:177) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime
на android.view.ViewRootImpl.doConsumeBatchedInput (ViewRootImpl.java:6817) 05-18 09: 49: 57.940 14335 14335 E AndroidRuntime ** at android.view.ViewRootImpl $ ConsumeBatchedInputRunnable.run (ViewRootImpl.java:6869) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
в android.view.Choreographer $ CallbackRecord.run (Choreographer).05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
на android.view.Choreographer.doCallbacks (Choreographer.java:778) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
на android.view.Choreographer.doFrame (Choreographer.java:707) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
at android.view.Choreographer $ FrameDisplayEventReceiver.run (Choreographer.java:952) 05-18 09: 49: 57.94114335 14335 E AndroidRuntime
на android.os.Handler.handleCallback (Handler.java:789) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
на android.os.Handler.dispatchMessage (Handler.java:98) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
на android.os.Looper.loop (Looper.java:164) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime на android.app.ActivityThread.main (ActivityThread.java:6809) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
в java.lang.reflect.Method.invoke (собственный метод) 05-18 09: 49: 57.94114335 14335 E AndroidRuntime на com.android.internal.os.Zygote $ MethodAndArgsCaller.run (Zygote.java:240) 05-18 09: 49: 57.941 14335 14335 E AndroidRuntime
на com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
ИСКЛЮЧИТЕЛЬНОЕ ИСКЛЮЧЕНИЕ: главное 05-18 12: 10: 59.002 29469 29469 E
Процесс AndroidRuntime: com.mycompany.myapp, PID: 29469 05-18 12: 10: 59.002 29469 29469 E
AndroidRuntime
android.content.ActivityNotFoundException: невозможно найти явный класс активности {com.mycompany.myapp / com.mycompany.myapp.Spinner_Activity};Вы объявили об этой активности в вашем AndroidManifest.xml?05-18 12: 10: 59.002 29469 29469 E AndroidRuntime на android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2123) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на android.app.Instrumentation.execStartActivity(Instrumentation.java:1801) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на android.app.Activity.startActivityForResult (Activity.java:4495) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
в android.app.Activity.startActivityForResult (Activity.java:4453) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
в android.app.Activity.startActivity (Activity.java:4814) 05-1812: 10: 59.002 29469 29469 E AndroidRuntime
в android.app.Activity.startActivity (Activity.java:4782) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
в com.mycompany.myapp.List_Widgets$ 100000000.onItemClick (List_Widgets.java:88) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
at android.widget.AdapterView.performItemClick (AdapterView.java:318) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
в android.widget.AbsListView.performItemClick (AbsListView.java:1197) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
в android.widget.AbsListView $ PerformClick.run (AbsList.java: 3166) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
at android.widget.AbsListView $ 3.run (AbsListView.java:4119) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на android.os.Handler.handleCallback (Handler.java:789) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на android.os.Handler.dispatchMessage (Handler.java:98) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на android.os.Looper.loop (Looper.java:164) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime на android.app.ActivityThread.main (ActivityThread.java): 6809) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на java.lang.reflect.Method.invoke (собственный метод) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime на com.android.internal.os.Zygote $ MethodAndArgsCaller.run (Zygote.java:240) 05-18 12: 10: 59.002 29469 29469 E AndroidRuntime
на com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767) 05-18 12: 10: 59.008 29469 29469 E AndroidRuntime
ФАТАЛЬНОЕ ИСКЛЮЧЕНИЕ:главная