好吧,由于setContentView行,我有一个应用程序在加载时崩溃.现在在你问之前,当我在第15行注释掉setContentView行时,我得到了一个有用的应用程序.但是当我放入它的那一刻,它就错了.现在这是使用2.1-update1 android.
Java的:
package com.clark.listview;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class listview extends ListActivity {
/** Called when the activity is first created. */
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
//setContentView(R.layout.main);
// Create an array of Strings, that will be put to our ListActivity
String[] names = new String[] { "Linux", "Windows7", "Eclipse", "Suse",
"Ubuntu", "Solaris", "Android", "iPhone", "ClarkPhone" };
// Use your own layout and point the adapter to …Run Code Online (Sandbox Code Playgroud) android ×1