<?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" >
<EditText
android:id="@+id/etNum"
android:layout_width="wrap_content"
android:layout_height="102dp"
android:hint="@string/Please enter a department number."
android:inputType="number"
/>
<EditText
android:id="@+id/etName"
android:layout_width="wrap_content"
android:layout_height="102dp"
android:hint="@string/Or enter a department name."
android:inputType="string"
/>
<requestFocus />
</LinearLayout>
** Q#1。在最后一行,我在这一行找到了多个注释: - 错误:解析 XML 时出错:标签不匹配 - 此文本字段未指定 inputType 或提示。不知道该怎么办?**
package walmart.namespace;
import android.R;
import android.R.string;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class WalmartActivity extends Activity {
/** Called when the activity is first created. */
int department;
String name;
Button search;
TextView display;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
q#2:对于 R.Layout.main,我有“main 无法解析或不是字段”。我知道我不应该在导入中使用 import android.R,但它至少摆脱了 R 的问题。关于如何解决这个问题的任何想法?