私は得ています
11-13 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.makemyday/com.example.makemyday.ActionDetailActivity}:java.lang.IllegalArgumentException: No view found for id 0x7f050007 (com.example.makemyday:id/action_detail_container) for fragment ActionDetailFragment{41e9add8 #0 id=0x7f050007}
action_detail_activity のコード
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_action_detail);
if (savedInstanceState == null) {
Bundle arguments = new Bundle();
String id= getIntent().getStringExtra(ActionDetailFragment.ARG_ITEM_ID);
arguments.putString(ActionDetailFragment.ARG_ITEM_ID, id);
ActionDetailFragment fragment = new ActionDetailFragment();
fragment.setArguments(arguments);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.action_detail_container, fragment);
SupportMapFragment mapFragment;
ImageFragment imageFragment;
Toast.makeText(this, ActionDetailFragment.ARG_ITEM_ID, Toast.LENGTH_SHORT).show();
if(id.equalsIgnoreCase("1"))
{
Toast.makeText(this, "here1", Toast.LENGTH_SHORT).show();
//mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
//map=mapFragment.getMap();
}
else if(id.equalsIgnoreCase("2"))
{
Toast.makeText(this, "here2", Toast.LENGTH_SHORT).show();
//imageFragment = (ImageFragment) getSupportFragmentManager().findFragmentById(R.id.picture_upload);
imageFragment=new ImageFragment();
ft.add(R.id.imageContainer, imageFragment);
}
ft.commit();
}
}
activity_action_detail.xml のコード
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+android:id/outer_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame">
<FrameLayout
android:id="@+android:id/action_detail_container"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<FrameLayout
android:id="@+android:id/imageContainer"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<Button
android:id="@+id/start_time_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="from" />
</LinearLayout>
誰かこれに答えてください