"意外停止"试10000次修复 [英] "Stopped Unexpectedly" tried 10000 times to fix
本文介绍了"意外停止"试10000次修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我主要的Java文件,MainActivity.java
here is my Main java file, MainActivity.java
package com.myprojects.schecklist;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends ListActivity {
private ListView listView;
private String[] items = { "Activity1", "Activity2" };
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.mylist);
listView.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, items));
}
}
和这里是activity_main.xml中
and here it is activity_main.xml
<?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/mylist"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
AndroidManifest.xml中
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myprojects.schecklist"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
至少我尝试了4-5的方法解决这个问题。最后,我想的项目>清除和不固定了。
我什么都试过,并至少我的工作就可以了约3天。怎么了?我要疯了。
At least i tried 4-5 methods fix that problem. At last i tried Project>Clear and its not fixed too. I tried everything and at least i'm working on it about 3days. What's wrong? I'm gonna be crazy.
推荐答案
ListActivity
尽量延长活动
或更改
<ListView
android:id="@+id/mylist"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
到
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
这篇关于&QUOT;意外停止&QUOT;试10000次修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文