我如何使android菜单适用于桌子和手机?

我如何使android菜单适用于桌子和手机?,android,menu,Android,Menu,我创建了一个带有菜单(关于、设置、退出)的android应用程序,可以与我的智能手机配合使用,但不能与平板电脑配合使用。我如何修复它?这是我的代码…适用于智能手机 @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.layout.menu, menu); return true; }

我创建了一个带有菜单(关于、设置、退出)的android应用程序,可以与我的智能手机配合使用,但不能与平板电脑配合使用。我如何修复它?这是我的代码…适用于智能手机

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
  MenuInflater menuInflater = getMenuInflater();
  menuInflater.inflate(R.layout.menu, menu);
  return true;
}

 @Override 
 public boolean onOptionsItemSelected(MenuItem item)
 {

  switch (item.getItemId())
  {
  case R.id.menu_exit:

      locationManager.removeUpdates(this);
       // wl.release();

      finish();
      return true;

  case R.id.menu_about:

      locationManager.removeUpdates(this);
       // wl.release();

      startActivity(new Intent(this, About.class));
      return true;    

  case R.id.menu_sos:

      locationManager.removeUpdates(this);
        //wl.release();

      startActivity(new Intent(this, sos.class));
      return true;

  case R.id.menu_map:

      locationManager.removeUpdates(this);
        //wl.release();
      Intent i = new Intent(getApplicationContext(), MarineNavigator.class); //Send current location to map
     i.putExtra("latcur",lat);
     i.putExtra("lngcur",lng);
     startActivity(i);

      return true;        

  case R.id.menu_setup_map: 

      locationManager.removeUpdates(this);
        //wl.release();

      startActivity(new Intent(this, Setup2.class));
      return true;            


  default:
      return super.onOptionsItemSelected(item);
  }
}
我测试这个…用于平板电脑和工作…但不显示任何图标或充气任何东西,只需进入下一个活动…我如何修改它来为我工作?一些添加代码?示例?谢谢

   public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
              //Default generate when we make app on Eclipse...
    getMenuInflater().inflate(R.menu.marine_navigator, menu);

    locationManager.removeUpdates(this);

  Intent i = new Intent(getApplicationContext(), MarineNavigator.class); //Send current location to map
     i.putExtra("latcur",lat);
     i.putExtra("lngcur",lng);
     startActivity(i);

    return true;
}

你面临的问题是什么?…你能解释一下吗?我如何修改第二个来工作?需要有人用代码告诉我…同样的代码可以在平板电脑和手机上工作(假设操作系统版本足够)。查看本指南:“平板电脑”是一个非常广泛的设备类别,您没有提供足够的信息让我们帮助您。我猜你还没有在所有的平板电脑上试用过,那么你测试过哪些平板电脑呢?他们正在运行哪些版本的Android?你的目标版本是什么?Android Sony Xperia智能手机测试它的OS 4.0和平板电脑三星OS 3.0.My apk Min7版。