【发布时间】:2014-05-20 17:31:26
【问题描述】:
我正在使用 android 中的选项卡主机将参数传递给新活动,但它显示非法异常
Intent homeintent;
// Create an Intent to launch an Activity for the tab (to be reused)
homeintent = new Intent();
Bundle bundle=getIntent().getExtras();
String strusername=bundle.get("strUserName").toString();
String strPassWord=bundle.getString("strPassword").toString();
String questGroupId=bundle.getString("questGroupId").toString();
homeintent.putExtra("strUserName", strusername);
homeintent.putExtra("strPassword",strPassWord );
homeintent.putExtra("questGroupId",questGroupId);
homeintent.setClass(this, HomeActivity.class);
spec = tabHost.newTabSpec("home").setIndicator("Home",res.getDrawable(R.drawable.home_tab_bar_icon)).setContent(homeintent);
tabHost.addTab(spec);
谁能告诉我如何在android中使用intent和tabhost传递参数?
【问题讨论】:
标签: android