私がやりたいことは、実際には次のような「アクションバー」です。
アクティビティを開始するときに、アクション バーの下にあるビューを置き換えたいと考えています。main.xml の例 (簡略化):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainLinear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- SIMPLIFIED ACTION BAR -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="65dp"
android:orientation="horizontal"
android:background="#333333">
<Button android:id="@+id/actionBtn"
android:text="@string/actionText"
android:textColor="#FFFFFF"
android:textSize="15sp"
android:layout_width="0.0dip"
android:layout_height="wrap_content"
android:contentDescription="@string/fillImage"
android:drawableTop="@android:drawable/ic_menu_agenda"
android:background="@drawable/tab_unselect"
android:layout_weight="1.0" />
</LinearLayout>
<Button
android:background="@drawable/btn_default_holo_light"
android:textSize="20sp"
android:id="@+id/BUTTON1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:textColor="#000000"
android:text="@string/button"
android:layout_below="@+id/klassenBtn"/>
</LinearLayout>
私の MainActivity.java では、 setContentView(R.layout.main,xml) を行います
web.xml 内:
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
ここで、別のアクティビティ (WebActivity.java) で BUTTON1 (@+id/BUTTON1) を webView1 (@+id/webView1) に置き換えたいと考えています。
前もって感謝します!