我已经创建了一个活动,现在我正在尝试向eventListener
按钮添加一个:
但是当我切换AddEntryActivity
到SuperNotCalledException()
. 非常感谢任何帮助!
public class AddEntryActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_entry);
ImageButton test = (ImageButton) findViewById(R.id.mg_add_entry_button_save);
...
这是我的 activity_add_entry.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity$PlaceholderFragment"
android:background="@drawable/radialback">
<LinearLayout
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:id="@+id/mg_overview"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_above="@+id/mg_menu_bar">
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:inputType="numberDecimal">
</EditText>
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:inputType="date"/>
<Spinner
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/mg_add_entry_spinner_categories"
android:entries="@array/basic_categories_array"
android:prompt="@string/abc_activity_chooser_view_see_all"></Spinner>
<Button
android:id="@+id/mg_add_entry_button_save"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/mg_save"/>
</LinearLayout>
<LinearLayout
android:id="@+id/mg_menu_bar"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal"
android:layout_alignParentBottom="true">
<ImageButton
android:id="@+id/mg_menu_button_add_entry"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/abc_ic_go"/>
</LinearLayout>
</RelativeLayout>