CoreStartHere.java
public class CoreStartHere extends TabActivity {
:
t = getTabHost();
t.newTabSpec("tTask");
t.setIndicator(...);
t.setContent(new Intent().setClass(this, T1Task.class);
:
}
t1Task.java
T1Task extends Activity {
:
onCreate(Bundle ...) {
:
myListview = (ListView) findViewById(R.id.hdListView);
myEditText = (EditText) findViewById(R.id.hdEditText);
hdItems = newArrayList <String>();
aa = new ArrayAdapter <String>(this, R.layout.hditemview, hdItems);
:
setOnKeyListener (new OnKeyListener() {
onKey(...) {
:
hdItems.add(0, myEditText.getText().toString());
aa.notifyDatasetChanged();
:
}
}
}
}
hditemview.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
class="com.a1.hd.hdRecordTaskListItemView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:scrollbars="vertical"
android:textColor="@color/HD_Text"
android:fadingEdge="vertical"
/>
hdRecordTaskListItemView.java
hdRecordTaskListItemView extends TextView {
// has 3 constructors
// onDraw
}
hdRecordTaskListItemView 中的构造函数都没有被调用,毫不奇怪 onDraw 也没有被调用。什么不见了?- 任何建议或问题 - 请告诉我。文本以默认样式显示。onDraw 应该在“画布”上绘制。谢谢