当第二次打开我的SupportMapFragment(Android maps v2)(调用setContentView)时,出现以下错误: 01-28 16:27:21.374: E/AndroidRuntime(32743): FATAL EXCEPTION: main 01-28 16:27:21.374: E/AndroidRuntime(32743): android.view.InflateException: Binary XML file line #6: Error inflating class fragment 01-28 16:27:21.374: E/AndroidRuntime(32743): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 01-28 16:27:21.374: E/AndroidRuntime(32743): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 01-28 16:27:21.374: E/AndroidRuntime(32743): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 01-28 16:27:21.374: E/AndroidRuntime(32743): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 01-28 16:27:21.374: E/AndroidRuntime(32743): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 01-28 16:27:21.374: E/AndroidRuntime(32743): at android.view.View.inflate(View.java:16119) 01-28 16:27:21.374: E/AndroidRuntime(32743): […]
我正在尝试使用为Android提供的最新的Map API 2.0。 我正在使用支持库,因为我想支持Android 2.2。 以下是我的代码: 主要活动类 public class MainActivity extends FragmentActivity { public FragmentManager fManager ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fManager = getSupportFragmentManager(); Button showMapButton = (Button) findViewById(R.id.showMapButton); showMapButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { loadMapFragment(); } }); } private void loadMapFragment() { MapPageFragment plotterFragment = new MapPageFragment(); […]